>From http://iis1.cps.unizar.es/Oreilly/perl/cookbook/ch04_07.htm, is this
really the best way to ensure an *ordered* list contains only unique values?
It seems like it could/should be easier. I wonder why the examples don't use my.
%seen = ();
@uniq = ();
foreach $item (@list) {
unless ($seen{$item}) {
# if we get here, we have not seen it before
$seen{$item} = 1;
push(@uniq, $item);
}
}
Faster
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>