I just wanted to point out the use of this module, because I need to find my IP address inside some script from time to time, and I just found Net::Interface.
With the following code, I find my IP addresses
map { join '.', unpack "CCCC", scalar $_->address() } Net::Interface->interfaces();
Or, to find out if a $ip is one of mine...
grep { $_ eq $ip } map { join '.', unpack "CCCC", scalar $_->address() } Net::Interface->interfaces();
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Getting my IP adresses
by cengineer (Pilgrim) on May 15, 2007 at 14:39 UTC |