in reply to Re^2: How to conditionally execute a subroutine defined as hash value
in thread How to conditionally execute a subroutine defined as hash value
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}();
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: How to conditionally execute a subroutine defined as hash value
by derby (Abbot) on Apr 02, 2014 at 11:15 UTC | |
by BrowserUk (Patriarch) on Apr 02, 2014 at 11:44 UTC | |
|
Re^4: How to conditionally execute a subroutine defined as hash value
by Anonymous Monk on Apr 02, 2014 at 10:50 UTC |