Lance Prais wrote:
>
> Well I am have finally got the code to recognized the right substring but
> not the issue is my if statement. Could someone see what I am doing
> wrong,please.
>
> For example I ran the script and got the following output:
>
> E:\sea621\siebsrvr\BIN\perl\bin>perl emailmgr.pl
> Successfully Completed Email Manager Working Sleeping for 10
>
> It should have sent the email but did not..
>
> #/usr/bin/perl
>
> $cmd = '..\\..\\srvrmgr /g apollo.ts.checkpoint.com /e CHK_ENT_PRD /s
> CHK_SBL_PRD /u xxxxxxxx /p xxxxxx /c "list tasks for server CHK_SBL_PRD
> component Email Manager" > ..\\..\\emailmgr.txt';
> $result = `$cmd`; # note back-ticks
>
> #open a file with the filehandle
> open EMAILMGR, "+<..\\..\\emailmgr.txt" or die "Cannot open email manager
> $!\n";
>
> #my $data = <EMAILMGR> for (1..22); #Testing to make sure I am
> #grabbing the correct data----
> for(my $i=0; $i<22; $i++){<EMAILMGR>}; #This will put you at row 23.----
> $_=<EMAILMGR>;
> my $line=$_;
>
> if (substr($line, 105, 16) eq "Sleeping for 10")
I don't see how this could ever match. The string "Sleeping for 10" is
15 characters long and you are comparing it to a 16 character string!
John
--
use Perl;
program
fulfillment
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]