in reply to Finding the IP of a local box

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.