Look at the error message
> E:\sea621\siebsrvr\BIN\Perl\bin>outlook.pl
> Global symbol "%mail" requires explicit package name at
> E:\sea621\siebsrvr\BIN\P
> erl\bin\outlook.pl line 21.
[snip]
When you use strict, you need to explicitly define your variables using "my"
or "our"
> #!/usr/bin/perl -w
>
> use strict;
>
>
> my $count = "";
> open MAIL_LOG, ">> siebel_mail.log" or
> die "can't append to siebl_mail.log: $!";
> # do this 7 times
> for (1 .. 7) {
> open OUTPUT, '..\\..\\srvrmgr /g apollo.ts.checkpoint.com /e CHK_ENT_PRD
> /s CHK_SBL_PRD /u xxxxx /p xxxxxxxx /c "list tasks for server CHK_SBL_PRD
> component Email Manager" |' or
> die "can't run srvrmgr: $!";
> <OUTPUT> for 1 .. 22; # skip first 22 lines of output
> my $line = substr <OUTPUT>, 106, 22;
> close OUTPUT;
> print "Count $count\n";
> if ($count eq 3)
> {
>
> use Mail::Sendmail; #Send and email if there are
> errors
> %mail = ( To => [EMAIL PROTECTED]',
change above line to:
my %mail = ( To => [EMAIL PROTECTED]',
> From => [EMAIL PROTECTED]',
> Subject => '',
> Message => 'Email Manager hung on Apollo'
> );
> sendmail(%mail) or die $Mail::Sendmail::error;
> print "OK. Log says:\n", $Mail::Sendmail::log;
> }
> else
> {
> if ($line eq "Sleeping for 10 second")
> {
> $count++;
> }
> else
> {
> print $line, "\n";
> print MAIL_LOG $line, "\n";
> }
> sleep 10;
> }
> }
> close MAIL_LOG;
>
> # open MAIL_LOG to read to see how many times "sleeping for 10 seconds
> occurs"
HTH
- geoff
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]