Then you'll need to wrap the calls in anonymous subs:
my $calls = { A => sub{ print_A( \%config_A ); }, B => sub{ print_B( \%config_B ); }, }; my $test = 'A'; $calls->{$test}();
In reply to Re^3: How to conditionally execute a subroutine defined as hash value
by BrowserUk
in thread How to conditionally execute a subroutine defined as hash value
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |