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