-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
In reply to Re^3: problem with $ARG
by ikegami
in thread problem with $ARG
by Discipulus
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |