#! perl -l use strict; use warnings; sub test{ our $test{localsub} = sub{ print 'localsub1'; return 12345; } unless exists $test{localsub}; $test{localsub}->(); } print test; __END__ P:\test>junk syntax error at P:\test\junk.pl line 6, near "$test{localsub" Execution of P:\test\junk.pl aborted due to compilation errors.