http://www.perlmonks.org?node_id=695623


in reply to Automatically importing a subroutine for a particular namespace

AFAIK fatalsToBrowser is not an exported subroutine, but a hook that installs a process-wide DIE handler. IOW you generally only want to call fatalsToBrowser once, at some place that easy to find so you can remove it when deploying your code in production.

In the general case of importing modules/variables in lots of modules, I prefer to import everything I want into some package and automatically export them from there:

package My::Tools; use Something qw(foo bar); use Other qw(blip blob); use Exporter; our @ISA = 'Exporter'; our @EXPORT = qw(foo bar blip blob);
Note that this package does not have to be a base class of anything. You only have to use it wherever it's needed:

package Foo::Bar::Asdf; use My::Tools;