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 }
In reply to Tricky scope problem by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |