You're incrementing an element of %seen twice with each pass. That will prevent printing, but @uniq should contain what you expect.
Try this instead:
my @uniq; my %seen; for (0 .. $#name1) { next if $seen{$name1[$_]}++; push @uniq, $name1[$_]; print "$name1[$_]\t$name2[$_]\t$percent[$_]\n"; }
After Compline,
Zaxo
In reply to Re: finding the first unique element in an array
by Zaxo
in thread finding the first unique element in an array
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |