jacques has asked for the wisdom of the Perl Monks concerning the following question:
So I have a suite of modules under a namespace. Lets call it 'Foo::Bar'. So one of these modules would be:
Anyway, I noticed that all of the modules under 'Foo::Bar' use CGI::Carp 'fatalsToBrowser'.Foo::Bar::Asdf.pm
There are a lot of modules under this namespace and they all import the same subroutine. What I would like to do is to stop declaring use CGI::Carp 'fatalsToBrowser' for every module and only declare it once. How could I do this, without using a new base class?package Foo::Bar::Asdf; use CGI::Carp 'fatalsToBrowser';
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Automatically importing a subroutine for a particular namespace
by Joost (Canon) on Jul 04, 2008 at 18:56 UTC | |
by jacques (Priest) on Jul 04, 2008 at 19:24 UTC | |
by Anonymous Monk on Jul 05, 2008 at 01:28 UTC | |
by jacques (Priest) on Jul 05, 2008 at 02:30 UTC | |
by Joost (Canon) on Jul 05, 2008 at 21:53 UTC | |
Re: Automatically importing a subroutine for a particular namespace
by pc88mxer (Vicar) on Jul 04, 2008 at 18:51 UTC | |
Re: Automatically importing a subroutine for a particular namespace
by dragonchild (Archbishop) on Jul 05, 2008 at 04:39 UTC |
Back to
Seekers of Perl Wisdom