I have many standalone scripts. The only thing they share, is that they use() a large set of CPAN modules (that each export several functions). I would like to centralize this list of modules. I found several methods. Which one is the best?
I could create SharedModules.pm that imports everything and then manually exports everything to main:: using Exporter.
I could create SharedModules.pm that starts with "package main;" so it will import directly into main::. It seems to work. Is it bad practice and why?
I could require() a sharedmodules.pl that seems to import everything into main:: as well. I don't like this method as require() doesn't work that well under mod_perl.
Number two looks best to me, however I wonder why for example Modern::Perl doesn't work that way.
Edit: I figured this question has been asked before.