in reply to Re^5: Is it possible to create a sub exclusive to a sub?
in thread Is it possible to create a sub exclusive to a sub?
#!/usr/bin/perl -l use strict; use warnings; use vars qw( %test ); sub 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.
Makeshifts last the longest.
janitored by ybiC: Prepend "(Duplicate)" to nodetitle to indicate that this node is exact duplicate of Re^6: Is it possible to create a sub exclusive to a sub? (id://392165) above
|
|---|