Update: I rewrote this post after doing some testing.
The string is passed to the DOS shell cmd.exe to parse and execute. cmd.exe's directory should be in the PATH. (perl should probably check COMSPEC, but it doesn't.) You need to put cmd.exe in the current directory, or place it's directory in the PATH.
system("c:\windows\system32\cmd.exe /c echo hello > tmp.log"); doesn't help.
Changing sh= in Config.pm doesn't help.
That means if you're in Win95/98/ME, you're in trouble because cmd.exe is for WinNT/2K/XP. You could recompile perl yourself...
btw,
$tmp_log = `echo hello`;
might be more along the lines of what you want than
system("echo hello > tmp.log");,
but that won't fix your problem.
In reply to Re: redirecting output in perl
by ikegami
in thread redirecting output in perl
by sparkel
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |