The Perl FAQ suggests the following:
use Socket qw( inet_ntoa ); use Net::Domain qw( hostfqdn ); my $my_host = hostfqdn(); my $my_ip = inet_ntoa scalar gethostbyname $host;
You should also read up the FAQ on the name of the language.
Updated. I misread it the FAQ the first time around.
In reply to Re: Finding the IP of a local box
by ikegami
in thread Finding the IP of a local box
by a2K
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |