|
|
| Perl Monk, Perl Meditation | |
| PerlMonks |
Re: How To Read Hosts File Into a Hashby jwkrahn (Abbot) |
| on Sep 16, 2011 at 00:58 UTC ( [id://926273]=note: print w/replies, xml ) | Need Help?? |
|
You shouldn't quote variables like that: What's wrong with always quoting "$vars"? The high precedence of the || operator means that die will only execute if $hostfile contains the string "" or the string "0". You need to either use parentheses with open:
Or use the low precedence or operator:
That should probably be:
Or if you want all the hosts associated with each IP address:
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||||||||