Hi List,
Again I need your help, script in question is here:
#usr/local/perl -w
use strict;
use Socket;
open(OUTPUT,">>iplisted.txt") or die "can't open iplisted.txt $!";
foreach (<DATA>) {
s/\s+//;
my $address = $_;
my $name = gethostbyaddr(inet_aton($address), AF_INET)
or die "Can't resolve $address: $!\n";
print OUTPUT "$_ =>$name \n";
}
__DATA__
10.160.71.239
10.160.72.4
10.160.73.99
10.160.74.69
10.160.74.70
10.160.73.31
10.160.3.20
10.160.73.52
10.160.77.208
above code will work just fine until it could encounter unresolvable ip
address, the nthe problem occur, it won't finish processing the rest on the ip
address list instead it quit the script. How can rewrite it, so even it
encounters such an error it would still continue? Thank you for all the help.
###############Sample Error#############:
10.160.3.20
Can't resolve 10.160.3.20:
---------------------------------
How low will we go? Check out Yahoo! Messengers low PC-to-Phone call rates.