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