Pathologically Eclectic Rubbish Lister | |
PerlMonks |
Re: Looping through numerous snmp strings....by jwkrahn (Abbot) |
on Sep 19, 2012 at 19:51 UTC ( [id://994512]=note: print w/replies, xml ) | Need Help?? |
Consistency is always good. You should stick with either ( ... ) || ... or ... or ... The use of $! with backticks is wrong. You SHOULD be using $! to indicate errors from open and $? to indicate errors from backticks.
You are using printf when you should be using print.
foreach needs to read the entire file into memory first before it can loop through the lines. The usual, more efficient method is to use a while loop if you only need one line at a time.
Why are you copying the value in $_ to a string when it is already a string?
In Section
Seekers of Perl Wisdom
|
|