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);
In reply to Re: Loading all modules under a directory
by bschmer
in thread Loading all modules under a directory
by perl_devel
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |