in reply to Loading all modules under a directory

I've used something like this several times. It doesn't require having things under the same namespace and it can be enhanced to recurse if desired.
my $dir = "/path/to/modules"; opendir(DIR, $dir); while (my $mod = readdir(DIR)){ next unless $mod =~ /\.pm$/; # print "Use $mod\n"; eval "use $mod"; if ($@) { print $@, "\n\n\n"; exit(1); } } closedir(DIR);