Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
My problem is in the comparison within the hash. I seem to loose the very first duplicate name. I understand why, but am unclear with a solutionmy %seen = (); while (<DATA>) { if ($seen{$name}++) { push @names, $name; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: capturing duplicates
by tilly (Archbishop) on Jun 27, 2003 at 19:03 UTC | |
|
Re: capturing duplicates
by Zed_Lopez (Chaplain) on Jun 27, 2003 at 22:01 UTC |