#!/usr/bin/perl use Net::Ping6; open(INFILE, "<", "/home/olle/file2.txt") or die("cannot open infile: + $!"); my @ip_array = <INFILE>; close(INFILE); open(OUTFILE, ">", "ping_output") or die("unable to write output: $!") +; chomp(@ip_array); $p = Net::Ping->new(); foreach(@ip_array) { if($_ =~ /\d+.\d+.\d+.\d+/) { if($p->ping6($&)) { print OUTFILE ("$`is responding to ping.\n"); } else { print OUTFILE ("$`is NOT responding to ping.\n"); } } } close(OUTFILE);
In reply to Re^3: PERL SCRIPT FOR IPv6 LOOK-UP
by sam127
in thread PERL SCRIPT FOR IPv6 LOOK-UP
by sam127
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |