in reply to calling functions from data in variables
but don't do that. It will complain (as well it should) under use strict;
Use a dispatch table instead:
use strict; sub func { print "func ran\n"; } my %dispatch = ( func => \&func ); my $var = 'func'; &{$dispatch{$var}}();
|
|---|