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 th
Maybe more flexible than putting everything into main namespace would be to import into caller's namespace. Something like this:
main
package SharedModules; sub import { my $pkg = (caller())[0]; eval <<"EOD"; package $pkg; use List::Util; use List::MoreUtils; EOD die $@ if $@; } 1;