my @array = ($command, $arg1, $arg2, $arg3); system "@array > $outfile"; #### Can't spawn "cmd.exe": No such file or directory at D:\advanced_programming\test_syscall.pl line 11. and my @array = ($command, $arg1, $arg2, $arg3); open CMD, "@array > $outfile" or die "open() failed - $!"; #### Name "main::CMD" used only once: possible typo at D:\advanced_programming\test_syscall.pl line 17. open() failed - Invalid argument at D:\advanced_programming\test_syscall.pl line 17.