use warnings; sub FUNC{ print "I'm in func\n"; } { local(*FUNC) = sub { print "now overridden\n"; }; FUNC(); } FUNC();