enigma has asked for the wisdom of the Perl Monks concerning the following question:
Hello PerlMonks,
I need your help to understand how to use a hash value as a subroutine name while "strict ref" is in use-
use strict; my $code_ref = {'SUM', 'sum'}; sub sum($$){...} ($codes->{'SUM'})->(4,5);
Result: gives an error -
Can't use string ("sum") as a subroutine ref while "strict refs" in use at ...Thanks.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: HASH value as a subroutine call
by Perlbotics (Archbishop) on Oct 21, 2012 at 10:49 UTC | |
by AnomalousMonk (Archbishop) on Oct 21, 2012 at 11:46 UTC | |
|
Re: HASH value as a subroutine call
by Anonymous Monk on Oct 21, 2012 at 10:49 UTC |