Here is a snippet of the code: my $MyFileHand; my $MyFileHand1; open($MyFileHand,"<$MyFileIn") || diet (3, $MyFileIn, $!); open($MyFileHand1,"<$MyFileIn1") || diet (3, $MyFileIn1, $!); ............ proc_getrcd( $MyFileHand , $MyEOFProd, $MyWorkp, $MyInp , $GlblInfo{compcnt}, $MyUnpackSw ); proc_getrcd( $MyFileHand1, $MyEOFTest, $MyWorkt, $MyInt , $GlblInfo{compcnt}, $MyUnpackSw );
Subroutine being called: sub proc_getrcd { # 0 1 2 3 4 5 my ( $MyFileHand, $MyEOF, $MyWork, $MyIn, $MyRunningCnt, $MyUnpack ) = @_; return if ( $MyEOF ); my $MyData = <$MyFileHand>; if ( ! defined $MyData ) { $_[1] = 1; printf "EOF hit on read: %7d\n", $MyIn; return; } $_[3]++; $_[4]++; chomp($MyData); $MyData =~ s/[[:cntrl:]]/ /g if ( $MyData =~ /[[:cntrl:]]/ ); if ( $MyUnpack ) { @{$MyWork} = unpack($GlblInfo{unpackv},$MyData); } else { $MyWork->[0] = substr($MyData,10,16); $MyWork->[1] = substr($MyData,1126,10); $MyWork->[0] =~ s/\s+//g; } } # end of proc_getrcd I have three main subs that I am using to print and then compare the data: sub 1 reads the first 10 rcds of the Test file and prints out the data sub 2 reads the first 10 rcds of the Prod file and prints out the data Now these subs use the the same above sub, but is doing the unpack into the passed array. I have checked the output in the different elements and they are different in value and the key for each record is there so I know it has gottent the next rcd. sub 4 is the compare and reading of both files, but always ends up only doing the read Know I am mssing something very basic, but escapes me. Thanks. Wags ;) David R Wagner Senior Programmer Analyst FedEx Freight 1.408.323.4225x2224 TEL 1.408.323.4449 FAX http://fedex.com/us ********************************************************************** 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. **********************************************************************