this is a script that systematically pings every host on the network, and writes the output to the screen. If the -n arg is specified, it will also write to a disk. What's wrong with the syntax, especially line 12?

#!/usr/bin/env perl


$x = 1;
$b = 0;
for ($x = 1; $x < 256; $x++) {
$a = `ping -q -c 1 192.168.1.$b`;
$b += 1;
print "192.168.1.$b ";
print $a;
$usage="ping.pl [-n]"
if ($arg = "-n") {$e = 0}
else {$e = 1}
if ($e = 1) {
open (LOG, ">>/perl/pinglog.txt";
print `date`;
print $a;
}
else {}
}



Am I doing my ifs correctly? Thanks,
mark
got root?


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to