my $x = \&foo; *foo = sub { 'yep' }; print $x->(), "\n"; __END__ yep