in reply to Append to file or create file depending on input filename.
The argument >outfile never reaches the Perl script. The shell interprets it as you asking to execute perl script.pl and send its output to outfile. As far as Perl knows, there are no command-line arguments to script.pl. If you want to optionally use the filename to change your output behavior, you'll have to do so without using the > character as the first character of your argument.C:\>perl script.pl >outfile
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Append to file or create file depending on input filename.
by pKai (Priest) on Nov 20, 2009 at 13:48 UTC | |
|
Re^2: Append to file or create file depending on input filename.
by markuhs (Scribe) on Nov 20, 2009 at 13:42 UTC |