in reply to How to find IP address from hostname?

perldoc -f gethostbyname is a little confusing, since it gloms together docs for several functions.

It does, however, point you towards the Socket module (perldoc Socket). The Socket module buys you the handy inet_ntoa() function, as well as other helpful functions and constants.

Maybe this snippet will help a bit:

use Socket; $ip = gethostbyname("www.cnn.com"); $string = inet_ntoa($ip); print $string . "\n";