in reply to Re: Re: Killing dupes
in thread Killing dupes
The quickest way I can see to modify your code is:
(<DB>) creates an array, which we grep for unique elements. Well we really just throw out the duplicates because they create duplicate keys in %seen.open (DB,"flat-file.txt") or die "couldn't open flat-file.txt: $!"; my %seen; @content= grep {!$seen{$_}++} (<DB>);
Though it would probably be better not to slurp the entire array into memory unless you really need to.
-Blake
|
|---|