Strictly speaking, if you get the syntax right there is no need for no strict 'refs';. See choroba's reply above and your updated test code below.
use strict; use warnings; my %JumpTbl = (TestSub1 => \&TestSub1, TestSub2 => \&TestSub2); my @FuncList = values %JumpTbl; $JumpTbl{'TestSub2'}(); $FuncList[0](); sub TestSub1 { print "TestSub1\n"; } sub TestSub2 { print "TestSub2\n"; }
In reply to Re^2: Calling func named in string
by GrandFather
in thread Calling func named in string
by MikeL
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |