sub foo :method { my $self = shift; # ... return; } sub bar { # ... return; } use attributes; sub is_a_method { scalar grep $_ eq 'method', attributes::get($_[0]); } for ([ foo => \&foo ], [ bar => \&bar ]) { print "$_->[0] is a " . (is_a_method($_->[1]) ? 'method' : 'function') . "\n"; } __END__ foo is a method bar is a function