package My::Package; .. lots of code .. package Foo::Bar; # my version of do_magic sub do_magic { } # end of my tinkering with Foo::Bar 1;