my ($rpt_name, $desname, $btch, $record) = @ARGV[0..3]; #### # following the above my @args= ("path/to/prog", "report=$rpt_name" , ...); #### #get rid of $retval, too, unless you need it system(@args) and die "System failed: $?\n";