use strict; sub foo { print "this is foo(@_)\n" } sub bar { print "this is bar(@_)\n" } __PACKAGE__->can($_)->('invoked via can()') for qw/ foo bar /; ( \&$_ )->('invoked without a temp var') for qw/ foo bar /; __output__ this is foo(invoked via can()) this is bar(invoked via can()) this is foo(invoked without a temp var) this is bar(invoked without a temp var)