in reply to Passing package/module names to script as argument

push(@objects, $_->new()) foreach ("greenObjects", "redObjects"); already does (mostly) the same as push(@objects, greenObjects->new()); push(@objects, redObjects->new()); so this only leaves the use statements. It looks like Module::Load does what you want without needing to call eval.

autoload $_ and push(@objects, $_->new()) foreach @ARGV;

Edit: Module::Load accepts an arbitrary path though, so you might have to check the input for security.