my @modules = split ",", $ARGV[0]; my @paths = split ":", $ARGV[1]; #change to ';' or other on Windows, if needed push(@INC, @paths); $@ = undef; map { eval("require $_;") unless $@ } @modules; if($@) { die "one or more modules failed: $@"; } #rest of script