Pathologically Eclectic Rubbish Lister | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Your use of eq is actually comparing the number of elements in each array, which is why you only see a failure if one file has more lines than the other. If you're using Perl 5.10 or newer, you can achieve what you want using ~~ (the smart match operator) instead:-
If you're using Perl 5.8 or older, you'll need to compare the arrays element by element, an example of which you can find in perlfaq4 - How do I test whether two arrays or hashes are equal?. --k. In reply to Re: Comparing unordered but similar data files
by Kanji
|
|