Is there a Perl module or technique that makes using long namespaces easier?
- by Robert P
Some namespaces are long and annoying. Lets say that i downloaded hypothetical package called FooFoo-BarBar-BazBaz.tar.gz, and it has the following modules:
FooFoo::BarBar::BazBaz::Bill
FooFoo::BarBar::BazBaz::Bob
FooFoo::BarBar::BazBaz::Ben
FooFoo::BarBar::BazBaz::Bozo
FooFoo::BarBar::BazBaz::Brown
FooFoo::BarBar::BazBaz::Berkly
FooFoo::BarBar::BazBaz::Berkly::First
FooFoo::BarBar::BazBaz::Berkly::Second
Is there a module or technique I can use that's similar to the C++ 'using' statement, i.e., is there a way I can do
using FooFoo::BarBar::BazBaz;
which would then let me do
my $obj = Brown->new();
ok $obj->isa('FooFoo::BarBar::BazBaz::Brown') ; # true
# or...
ok $obj->isa('Brown'); # also true