$pid =fork; unless ($pid){ for $i ($ARGV[0] .. $ARGV[1]){ system "gnuplot plot.temp\nrm plot.temp"; } } waitpid($pid,0);