Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
my $gVar; sub Foo { my $listOfHashRef = generateList(); my $functionPtr; foreach $gVar (@$listOfHashRef) { $functionPtr = $gVar->{funPtr}; # Assert: $gVar has all of its values here $functionPtr->(); } } # Assert: The $gVar->{funPtr} does indeed point to Bar sub Bar { print "$gVar\n"; # Assert: $gVar is null }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Tricky scope problem
by shmem (Chancellor) on Apr 10, 2009 at 21:03 UTC | |
by Anonymous Monk on Apr 13, 2009 at 14:41 UTC | |
by shmem (Chancellor) on Apr 13, 2009 at 19:52 UTC | |
|
Re: Tricky scope problem
by kennethk (Abbot) on Apr 10, 2009 at 21:00 UTC | |
by lostjimmy (Chaplain) on Apr 11, 2009 at 00:07 UTC | |
by AnomalousMonk (Archbishop) on Apr 11, 2009 at 00:33 UTC | |
by lostjimmy (Chaplain) on Apr 11, 2009 at 15:42 UTC | |
by kennethk (Abbot) on Apr 11, 2009 at 13:19 UTC | |
by lostjimmy (Chaplain) on Apr 11, 2009 at 15:50 UTC |