in reply to Ping sweep with reporting
#!/usr/bin/perl use strict; use warnings; my $ping = "/bin/ping"; while (<DATA>){ chomp; my $ping_out = `$ping $_ 2> /dev/null`; chomp ($ping_out); if ($ping_out !~ /bytes from/) { print "$_ isn't pinging\n"; } else { print "$_ is up\n"; } __DATA__ SERVER01 SERVER02
But.. I receive this when I run it:
[root@stewie ~]# perl 615424.pl Missing right curly or square bracket at 615424.pl line 17, at end of +line syntax error at 615424.pl line 17, at EOF Execution of 615424.pl aborted due to compilation errors.
Any clues??
Edit: g0n - code tags
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Ping sweep with reporting
by liverpole (Monsignor) on May 17, 2007 at 00:53 UTC | |
by StarkRavingCalm (Sexton) on May 17, 2007 at 14:31 UTC | |
by StarkRavingCalm (Sexton) on May 17, 2007 at 20:19 UTC | |
by liverpole (Monsignor) on May 17, 2007 at 22:13 UTC | |
by StarkRavingCalm (Sexton) on May 17, 2007 at 20:14 UTC | |
|
Re^2: Ping sweep with reporting
by Fletch (Bishop) on May 17, 2007 at 00:16 UTC |