package Module; use strict; use warnings; use Attribute::Handlers; #sub TRACE :ATTR(CODE) { # Test 1 #sub TRACE :ATTR(CODE,INIT) { # Test 2 #sub TRACE :ATTR(CODE,CHECK) { # Test 3 sub TRACE :ATTR(CODE,BEGIN) { # Test 4 my ($pkg, $sym, $ref, $attr, $data, $phase, $file, $line) = @_; *{ $sym } = sub { warn "$file($line) called with [@_]\n"; my( @rc )= &$ref; warn "$file($line): returning [ @rc ]\n"; } } sub new :TRACE{ my $instance = shift; my $class = ref($instance) || $instance; my $self = {}; return bless($self, $class); } END { } 1; __END__