my $subname = "package::sub"; if (my $coderef = main->can($subname)) { $coderef->(@args); } #### use strict; my $coderef = \&$subname; $coderef->(@args); #### perldoc strict: There is one exception to this rule: $bar = \&{'foo'}; &$bar;
## use strict; my $coderef = \&$subname; $coderef->(@args); ##
## perldoc strict: There is one exception to this rule: $bar = \&{'foo'}; &$bar;