Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/local/bin/perl @a = (<DATA>); $s = system("$?"); foreach (@a) { system("/usr/sbin/ping $_"); print system("$?\n"); if ( $? != 0) { print "Could not ping host."; } else { print "Ping successful.\n"; } } close(DATA); __DATA__ 111.111.111.111 222.222.222.333 232.454.556.565
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: My Ping attempt in perl
by DamnDirtyApe (Curate) on Jul 05, 2002 at 18:10 UTC | |
by jmarshall99 (Acolyte) on Jul 06, 2002 at 03:41 UTC | |
|
Re: My Ping attempt in perl
by grinder (Bishop) on Jul 05, 2002 at 20:44 UTC | |
by shotgunefx (Parson) on Jul 05, 2002 at 21:10 UTC | |
|
Re: My Ping attempt in perl
by flounder99 (Friar) on Jul 05, 2002 at 20:00 UTC | |
|
Re: My Ping attempt in perl
by Anonymous Monk on Jul 05, 2002 at 18:18 UTC | |
by Anonymous Monk on Jul 06, 2002 at 00:45 UTC | |
by Anonymous Monk on Jul 05, 2002 at 18:20 UTC | |
|
Re: My Ping attempt in perl
by cybear (Monk) on Jul 05, 2002 at 19:44 UTC |