In Perl, using Moo
, you can implement around
subs, which will wrap around other methods in a class.
around INSERT => sub {
my $orig = shift;
my $self = shift;
print "Before the original sub\n";
my $rv = $orig->($self, @_);
print "After the original sub\n";
};
How can this behaviour be implemented in Raku, preferably using a role
?