in reply to Re: Re: Comparing two files
in thread Comparing two files

I suggest you check elsewhere in this very thread to see something that will likely be very fast while still being very easy to write. [ I've really grown to like sorting replies by reputation (see your User Settings) ]

Update: Though, if you want to ignore blank lines, then that won't work. So here:

my( $lineA, $lineB ); while( 1 ) { $lineA= do { while(<FILE1>){ last if /\S/ }; $_ }; $lineB= do { while(<FILE2>){ last if /\S/ }; $_ }; last if ! defined $lineA || ! defined $lineB; for( $lineA, $lineB ) { s/\s+/ /g; s/^ //; s/ $//; $_= lc $_; } last if $lineA ne $lineB; } if( defined($lineA) || defined($lineB) ) { warn "The files are different!\n"; }

        - tye (but my friends call me "Tye")