package AspectPostcon; use strict ; use warnings; use Exporter; use Aspect qw(advice returns); our @ISA = qw(Exporter); our @EXPORT_OK = qw(post_insert); my $subr = sub { print $::thisjp->sub . " has done its work.\n"; print "Tell God a $_[0] has been created.\n" if $_[0] =~ /saint/i; return 1; }; my $spec = qr/main::insert_.*/; my $post_insert = advice(returns($spec), $subr); sub post_insert {$post_insert}; 1;