my @b = uniq @a; my %seen; my @b = grep !$seen{$_}++, @a;
But if you really want to use reduce with just one expression, it's definitely possible.
my @b = @{( reduce { push @{$a->[1]}, $b if !$a->[0]{$b}++ } [ {}, [] +], @a; $a )->[1]};
In reply to Re: reduce like iterators
by ikegami
in thread reduce like iterators
by LanX
For: | Use: | ||
& | & | ||
< | < | ||
> | > | ||
[ | [ | ||
] | ] |