sub foo { ... } ... *foo = sub { ... }; # install new version of sub foo #### package Foo; sub bar { ... } package main; *::NewFoo = *::Foo; # or something like this NewFoo::bar(); # calls Foo::bar();