use Socket; my $hostname = 'win2kprof'; my $addr = inet_ntoa(scalar gethostbyname($hostname)); print "ip address is $addr\n";