Do you know where your variables are? | |
PerlMonks |
Re: Parsing Logsby johngg (Canon) |
on Oct 05, 2012 at 18:14 UTC ( [id://997527]=note: print w/replies, xml ) | Need Help?? |
You can also save some typing where you build your @array from the MSG file handle. Your
could be written
It is good practice to put
at the top of your scripts to enforce a little coding discipline and catch typos. It is also good practice to use lexical file handles, the three-argument form of open and to check that it succeeded (you do this), but also give the o/s error (see $! in perlvar) to give a better idea of why it failed.
I hope these points are helpful. Cheers, JohnGG
In Section
Seekers of Perl Wisdom
|
|