Compiling a package into a namespace

David Cantrell david at
Fri Apr 11 23:30:03 BST 2008

On Fri, Apr 11, 2008 at 08:25:06PM +0100, Simon Wistow wrote:
> On Fri, Apr 11, 2008 at 08:03:30PM +0100, Dave Cantrell said:
> > which is Just Fine.  Or are you worried about, eg, both of them defining
> > a subroutine with the same name?
> Unfortunately it's not only probably but guaranteed that they'll both 
> have the subroutines named the same.

In that case you're going to have to load one, then dig around in its
guts to move the subroutines to another namespace, then load the second
one. There's probably some ugly code you could rip out of
Sub::WrapPackages to help get you started.

It'll probably still break though if anything uses package-scoped
variables.  Yuck.

David Cantrell | A machine for turning tea into grumpiness

PLEASE NOTE: This message was meant to offend everyone equally,
regardless of race, creed, sexual orientation, politics, choice
of beer, operating system, mode of transport, or their editor.

More information about the mailing list