"be consistent" | |
PerlMonks |
Re: Parsing a log fileby grizzley (Chaplain) |
on Nov 29, 2007 at 14:41 UTC ( [id://653852]=note: print w/replies, xml ) | Need Help?? |
This is not the answer or help in the problem but hint how to make things other way. You could consider using -n or -p switch to ease your script. I use it all the time and it really saves me much thinking about file names and handles and other stuff like error handling. 1. Reading. Instead of and running like this: C:\>myscript.pl use this and run like this C:\>myscript.pl input_file.txt
2. Writing. Instead of opening CSV file and printing to it, print to STDOUT. And redirect to file like this: or Regardless which switch you choose, use the script like this: C:\>myscript.pl input_file.txt > OUTPUT.csv
In Section
Seekers of Perl Wisdom
|
|