With no change to the idiom, I'd write that as,Personally I prefer to use the "EXPR-form" of grep() if possible. But this largely depends on the case under examination: in some cases while it could be possible to use that, still it is more terse to adopt the "BLOCK-form", as you did.my %saw; my @out = grep { ! $saw{$_}++ } @in;
Definitely good point about my %saw; instead. But after all the snippet posted by the OP is too small to really understand wether he's using non-strict code or if he's reusing a previously used %saw (I wouldn't do that, FWIW) or...
In reply to Re^2: What does !$saw{$_}++ means
by blazar
in thread What does !$saw{$_}++ means
by nwkcmk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |