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}();
With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
|
---|
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 |
In Section
Seekers of Perl Wisdom