Package::Alias - alias one namespace into another
use Package::Alias Foo => 'main', P => 'Really::Long::Package::Name', 'A::B' => 'C::D', Alias => 'Existing::Namespace';
This module aliases one package name to another. After running the SYNOPSIS code,
@INC and
@Foo::INC reference the same memory.
$Really::Long::Package::Name::var and $P::var do as well..
Package::Alias won't, by default, alias over a namespace if it's already in use. That's not considered a fatal error - you'll just get a warning and flow will continue. You can change that cowardly behaviour this way:
# Make Bar like Foo, even if Bar is already in use. BEGIN { $Package::Alias::BRAVE = 1 } use Package::Alias Bar => 'Foo';
Joshua Keroes <skunkworks@eli.net>