>[EMAIL PROTECTED] wrote:
>:
>: My problem is it mails once then it will mail again about the
>: same string. I want it to only mail if it finds this string
>: but be smart enough not to email again if it happens again
>: within a certain time frame.

>    You'll need to save state somehow. This script only mails
>once.

>: foreach $tsm (@tsmdata) {
>:     if ($tsm =~ /AN[S,R]\d+/) {
>:         my $sub = "A_STKV440 TSM node had 1 or more ... \n"
>:         . "Please rerun A_STKV440 backup";
>:         print $tsm,"\n";
>:         #mailme($sub);
>:         last;
>:     }
>: }

>    That "last;" statement makes certain of it. So, the second
>email should be coming from a second instance of this script.
>You need some mechanism to allow each instance of the script to
>communicate with past instances or you'll need a better test
>than elapsed time.

>HTH,

>Charles K. Clarkson
>--
>Mobile Homes Specialist
>254 968-8328


--
well sort of but next time the script runs ( every 10 minutes) it finds the
same string "Errors" or the string ANS\d+||ANR\d+ and emails again.
Which is why I took Tims suggestion of a hash to reference back what was
already read.
see previous email. : )





-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to