in reply to How do I get the local internet IP address?
Non portable, return the ip address of all hosts found in /etc/hosts...
while (@adrs=(gethostent())[4]) { for my $value (@adrs) { print join '.',unpack('C4',$value); print "\n"; } }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Answer: How do I get the local internet IP address?
by arhuman (Vicar) on Jan 23, 2001 at 22:44 UTC |
In Section
Seekers of Perl Wisdom