Here is a watered down version, but unclear what I am missing. You should be able to cut and past. It is self contained and I am running on XP Pro, using AS 5.8.4.
What am I trying to do? Well I have to implement a new setup. So I pull the reports I use for the emails from one system and place on my test node. I then copy all the output from my first node to holding area. Then I run the processes on my test node. I then copy all the output from the test node to a holding area. I then bring up to a pc. I have a small script that reads the files, then does a count of carriage returns. If carriage returns are equal, then I compare the report output. What I have in the output is timestamps and run times which I need to remove otherwise will never be equal. This one seems so simple, yet it is eluding me. If you want to see more of the output, then you can uncomment the lines needed. Thanks for any insight and what I am doing wrong. Wags ;) ps I have alternated back from using $_ to not using, but it is never consistent. So I must be doing something wrong!! ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ cut starts on next line: #!perl use strict; use warnings; my @MyWrkP = (); my @MyWrkT = (); my $MyProdFile = 'aaaaa.pl026.02.P.txt'; my $MyTestFile = 'aaaaa.pl026.02.T.txt';; my $MyPtr = 1; my $MyWrkData = ''; my $MyProdCnt; my $MyTestCnt; while ( <DATA> ) { if ( /^\s*_{1,2}end\d_{1,2}\s*$/ig ) { if ( $MyPtr == 1 ) { $MyWrkP[0] = $MyWrkData; $MyPtr++; # $MyWrkData = $MyWrkP[0]; # $MyWrkData =~ s/\n/;/igm; # printf "Data into Prod\n<%s>\n", $MyWrkData; # printf "Number of ;(c/r): %d\n", ($MyWrkData =~ tr/;//); $MyWrkData = ''; next; }else { $MyWrkT[0] = $MyWrkData; $MyPtr++; # $MyWrkData = $MyWrkT[0]; # $MyWrkData =~ s/\n/;/igm; # printf "Data into Test\n<%s>\n", $MyWrkData; # printf "Number of ;(c/r): %d\n", ($MyWrkData =~ tr/;//); $MyWrkData = ''; last; } } $MyWrkData .= $_; } # # See if works here # if ( $MyProdFile =~ /\.0[23]\./g ) { $_ = $MyWrkP[0]; s/fes.//ig; if ( $MyTestFile =~ /pl026/ig ) { if ( ! s!^Run Date/Time of Report:\s+\d+\D\d+\D\d+\D\d+\D\d+\D\d+\s*\n!!ig ) { printf "No valid hit on change of date/time for pl026(P)\n"; printf "%s", $MyWrkP[0]; } }else { s/Date:\s+\d+\D\d+\D\d+\D\d+\D\d+\D\d+\s*$//igm; } $MyWrkP[0] = $_; $_ = $MyWrkT[0]; s/fes.//ig; if ( $MyProdFile =~ /pl026/ig ) { if ( ! s!^Run Date/Time of Report:\s+\d+\D\d+\D\d+\D\d+\D\d+\D\d+\s*\n!!ig ) { printf "No valid hit on change of date/time for pl026(T)\n"; printf "%s", $MyWrkT[0]; } }else { s/Date:\s+\d+\D\d+\D\d+\D\d+\D\d+\D\d+\s*$//igm; } $MyWrkT[0] = $_; } $MyProdCnt = ( $MyWrkP[0] =~ tr/\n// ); $MyTestCnt = ( $MyWrkT[0] =~ tr/\n// ); if ( $MyProdCnt == $MyTestCnt ) { printf " %6d == %6d<-c/r ", $MyProdCnt, $MyTestCnt; if ( $MyWrkP[0] eq $MyWrkT[0]) { printf "%-13s", 'Contents =='; }else { printf "%-13s", 'Contents !='; printf "Prod:\n<%s>\n", $MyWrkP[0]; printf "Test:\n<%s>\n", $MyWrkT[0]; } printf "$MyProdFile\n"; }else { printf " %6d != %6d%-20s$MyProdFile\n", $MyProdCnt, $MyTestCnt, ' '; } __DATA__ To => [EMAIL PROTECTED] Paul>[EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED] Subject => FESP:==Daily Run Contribution to Service for 02/10/05 Msg => Run Info: Report used As of Date : 5/2/10 Run Date/Time of Report: 05/02/10-05:20:20 Generated by program pl026 ************************************************************ Email Totals: Total Sent: 1 Details : 4 __END1__ To => [EMAIL PROTECTED] Paul>[EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED] Subject => FEST:==Daily Run Contribution to Service for 02/10/05 Msg => Run Info: Report used As of Date : 5/2/10 Run Date/Time of Report: 05/02/10-14:05:10 Generated by program pl026 ************************************************************ Email Totals: Total Sent: 1 Details : 4 __END2__ ^------ end of cut Any questions and/or problems, please let me know. Thanks! Wags ;) WGO: x2224 ******************************************************* This message contains information that is confidential and proprietary to FedEx Freight or its affiliates. It is intended only for the recipient named and for the express purpose(s) described therein. Any other use is prohibited. ******************************************************* -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>