Ronnie has asked for the wisdom of the Perl Monks concerning the following question:
my %scripts = ( "010" => { sub => "ACC_GET_STEP", step => '010', }, "020" => { sub => "ACC_PUT_STEP", step => '020', }, "030" => { sub => "ACC_GET_STEP", step => '030', }, );
However even if I remove the strict pragma this code still fails.Can't use string ("ACC_PUT_STEP") as a subroutine ref while "strict re +fs" in use at xxrc_test_putstep.pl line 211.
SCRIPT: for $script (sort keys %scripts) { next SCRIPT if ! defined $scripts{$script} {execute} ; $step = $scripts{$script} {step} ; $sub = $scripts{$script} {sub} ; if ($script == '020') { print "\n\tRunning Step :: $step Sub :: $sub\n" ; $result = system(&$sub($file, $step)) ; if ($result) { print "\n\tFailed!\n" ; } else { print "\n\tSucceeded!\n" ; } } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Referencing a hash of hashes
by Limbic~Region (Chancellor) on Aug 18, 2006 at 13:01 UTC | |
by Ronnie (Scribe) on Aug 18, 2006 at 13:45 UTC | |
|
Re: Referencing a hash of hashes
by imp (Priest) on Aug 18, 2006 at 13:03 UTC | |
by Ronnie (Scribe) on Aug 18, 2006 at 15:07 UTC | |
by imp (Priest) on Aug 18, 2006 at 15:20 UTC | |
by imp (Priest) on Aug 18, 2006 at 15:35 UTC | |
by chromatic (Archbishop) on Aug 19, 2006 at 01:12 UTC | |
by Ronnie (Scribe) on Aug 21, 2006 at 08:38 UTC |