* || -> or
* open with bare word file handle
git-svn-id: https://lab.mitty.jp/svn/lab/trunk@144
7d2118f6-f56c-43e7-95a2-
4bb3031d96e7
use Net::DNS;
-my $hostlist = shift @ARGV || die "usage: $0 list_of_hosts [nameserver]";
+my $hostlist = shift @ARGV or die "usage: $0 list_of_hosts [nameserver]";
if (! -r $hostlist) {
die "$0: cannot read $hostlist";
}
}
-open LIST, "<$hostlist";
-while (my $host = <LIST>) {
+open my $list, '<', $hostlist or die "$0: filename: $!";
+while (my $host = <$list>) {
chomp $host;
my $query = $res->send($host);
if ($query) {