Maybe you missed the fact that the first two of the messages you got were merely non-fatal warnings, and that all three of them did not happen until runtime. The message I got was compile time. Why are you using strict at all, if these arguments don't hold any weight with you?
If distant declarations bother you, use our.
#!/usr/bin/perl -l use strict; use warnings; sub test{ our %test; $test{localsub} = sub{ print 'localsub1'; return 12345; } unless exists $test{localsub}; $tset{localsub}->(); } print test; __END__ Global symbol "%tset" requires explicit package name at t.pl line 12. Execution of t.pl aborted due to compilation errors.
Update: I wrote our $test{localsub} = # ... at first, which is clearly wrong.
Makeshifts last the longest.
In reply to Re^8: Is it possible to create a sub exclusive to a sub?
by Aristotle
in thread Is it possible to create a sub exclusive to a sub?
by punkish
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |