in reply to System(), writing to a new file
If I've remembered my unix syntax, the following will send any error messages (on STDERR) to the file "error.txt"system("sort somefile.txt >somefile2.txt") or die;
IIRC you must use the single argument version of system() for redirections to work. (I think the multiple argument versions bypass the shell.) I'd check this though!system("sort somefile.txt >somefile2.txt 2>error.txt") or die;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: System(), writing to a new file
by zork42 (Monk) on Jul 19, 2013 at 15:11 UTC |