Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
BUT my email message excludes the last bad IP address (in this case 888.222.222.111) such as:888.333.333.33 156.343.333.99 888.323.222.223 888.222.222.111
Here is my script. I know it is something with my send mail part that is cutting out my output. Anyone have any suggestions???888.333.333.33 did not respond. 156.343.333.99 did not respond. 888.323.222.223 did not respond.
@a = (<DATA>); #$s = system("$?"); $myfil = "myfil"; foreach (@a) { system("/usr/sbin/ping $_"); if ( $? != 0) { open(FIL,">>$myfil") || "Can't open $myfil: $! \n"; print FIL "$_ did not respond.\n"; } else { print "good\n"; } } system("cat $myfil | mailx -s 'Did not ping mail' myemail\@here\.com") +; system("rm myfil"); close(FIL); close(DATA); __DATA__ 888.333.333.33 156.343.333.99 888.323.222.223 888.222.222.111
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Mail script is cutting out data.
by Abigail-II (Bishop) on Jul 08, 2002 at 16:48 UTC | |
|
Re: Mail script is cutting out data.
by rattusillegitimus (Friar) on Jul 08, 2002 at 16:47 UTC | |
|
Re: Mail script is cutting out data.
by fruiture (Curate) on Jul 08, 2002 at 16:49 UTC | |
by Aristotle (Chancellor) on Jul 08, 2002 at 17:12 UTC | |
by Anonymous Monk on Jul 08, 2002 at 17:08 UTC | |
|
Re: Mail script is cutting out data.
by Aristotle (Chancellor) on Jul 08, 2002 at 17:01 UTC | |
|
Re: Mail script is cutting out data.
by DamnDirtyApe (Curate) on Jul 08, 2002 at 17:44 UTC |