use Socket; my $hostname = 'yahoo.com'; print inet_ntoa(inet_aton($hostname)),"\n";