in reply to The correct way to redefine a routine

That will work, but... do any any other modules call Foo::Bar::do_magic, and will they work with your tinkered version? This includes the module Foo::Bar itself as well as any modules you are currently using or may use in the future. For instance, if Foo::Bar is a CPAN module, redefining do_magic can break a lot of things if your use another module which depends on the original version of the subroutine.

It is better to use sub-classing if you can:

package My::Foo::Bar; @ISA = qw(Foo::Bar); sub do_magic { ... } # tinker here
and then use My::Foo::Bar instead of Foo::Bar. Now the original do_magic is preserved for those other modules which need it.

Update: use base ... is better than setting @ISA, but they accomplish the same thing.