use strict; use warnings; use 5.012; sub xyz { print "xyz\n"; } local *say; *say = \&xyz; say 'hello'; --output:-- hello