in reply to Re: problem with $ARGin thread problem with $ARG
perl -MSocket -M5.010 -e 'say inet_ntoa((gethostbyname("name"))[4]);' [download]
-M5.010 -e can be written as -E
(gethostbyname($ARGV[0]))[4]) is clearer as scalar(gethostbyname($ARGV[0])) or just gethostbyname($ARGV[0]) if you check if gethostbyname succeeded.
perl -MSocket -E'say inet_ntoa gethostbyname(shift)||die "Not found\n"' example.com