P is for Practical | |
PerlMonks |
Re: Append to file or create file depending on input filename.by bellaire (Hermit) |
on Nov 20, 2009 at 13:36 UTC ( [id://808431]=note: print w/replies, xml ) | Need Help?? |
When you use a shell command like:
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.
In Section
Seekers of Perl Wisdom
|
|