Update: Got rid of a couple of useless lines which tye pointed out to me in the CB.open (F1,"f1.txt"); open (F2,"f2.txt"); while (<F1>){ $HASH_a{$_}++; ### two hashes } close(F1); while (<F2>){ $HASH_b{$_}++; ### two hashes used to compare unique sets } foreach $line (sort keys %HASH_a){ print "$line" if ( exists $HASH_b{$line} ); ### switched this to check for existence of a key ### in one hash which we know exists in the other. ### also removed the \n in the print, because we ### never chomp()ed them off the originals. }
In reply to Re: Comparing 2 files!!
by mr_mischief
in thread Comparing 2 files!!
by nofernandes
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |