Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
my $logfile = '/tmp/zzzz'; `touch $logfile` if (!(-e($logfile))); if (system( "ls", "-l", "/bin/bash", ">>", "$logfile", "2>&1" )) { print "Nope!\n"; } __END__ bash-2.05b$ perl a1.pl ls: >>: No such file or directory ls: 2>&1: No such file or directory -rwxr-xr-x 1 root root 598580 Sep 18 2003 /bin/bash -rw-rw-r-- 1 nooninmh man 0 Mar 29 18:52 /tmp/zzzz
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: system command has problem with '>>'
by JavaFan (Canon) on Mar 29, 2010 at 23:08 UTC | |
|
Re: system command has problem with '>>'
by Anonymous Monk on Mar 29, 2010 at 23:09 UTC | |
by mnooning (Beadle) on Mar 30, 2010 at 00:26 UTC | |
by Anonymous Monk on Mar 30, 2010 at 00:45 UTC | |
by ikegami (Patriarch) on Mar 30, 2010 at 02:50 UTC |