in reply to Re^5: undef/defined &{$name} while "strict refs"
in thread undef/defined &{$name} while "strict refs"
When we execute my code above, the script throws an exception because &{ 'run' } violates "strict refs". Khen1950fx explained how to avoid this problem (I appreciate his suggestion).
On the other hand, when we comment out &{ 'run' }, my script doesn't output error messages. This result shows the following doesn't violate "strict refs":It seems each line uses symbolic references. I don't understand why this is possible.my $walkable = defined &{ 'walk' }; undef &{ 'walk' };
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^7: undef/defined &{$name} while "strict refs"
by Anonymous Monk on Aug 21, 2012 at 08:25 UTC | |
by Athanasius (Archbishop) on Aug 21, 2012 at 08:33 UTC | |
by Anonymous Monk on Aug 21, 2012 at 08:45 UTC | |
by anazawa (Scribe) on Aug 21, 2012 at 10:08 UTC |