There's more than one way to do things | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Or the more perlish (read : normal, not perverted brain have difficulties to understand it)
*grin* while (@adrs=(gethostent())[4]) { map { $\="\n";print join '.',unpack'C4',$_} @adrs } BTW I'm sure a Perl Guru, could tell me how to make this even smaller ! Please show me the light ! UPDATE Ooops ! I suddenly realized that even if MY /etc/hosts contains only entries about my local machine, it might not always be the case (in fact it should often contains entries about other machines...). So thousand apologizes, but all my posts in this thread do not resolve the problem... But my code could be use to get the ip adresses of the machines in /etc/hosts... In reply to Re: Answer: How do I get the local internet IP address?
by arhuman
|
|