if ($^O eq "linux") { $cmd = "perl-prog.pl &> file1.out"; } else { $cmd = "start /MIN perl-prog.pl > file1.out 2> file2.out" } system ($cmd);