@listip is a list of ips
my $PING = "/usr/sbin/ping";
for ($lindex = 0; $lindex <= $#listip; $lindex++) {
print $listip[$lindex] . "\n";
$PING $listip[$lindex] ;
}
@listip is a list of ips
my $PING = "/usr/sbin/ping";
for ($lindex = 0; $lindex <= $#listip; $lindex++) {
print $listip[$lindex] . "\n";
$PING $listip[$lindex] ;
}
You're missing a system() there (perldoc -f system)
That, and it's enough to interate to $lindex<$#listip