in reply to redirecting output in perl
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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: redirecting output in perl
by Anonymous Monk on Sep 20, 2004 at 18:52 UTC | |
by ikegami (Patriarch) on Sep 20, 2004 at 19:00 UTC | |
by sgifford (Prior) on Sep 20, 2004 at 21:21 UTC |