#!/usr/bin/perl -w use strict; use Socket; my $arg = shift; if ($arg =~ /^(\d+\.){3}\d+$/) { print scalar gethostbyaddr(inet_aton($arg), AF_INET), "\n" } else { printf "%vd\n", scalar gethostbyname $arg }
You need to create an account or log in to post comments to this site.