in reply to Re: What does !$saw{$_}++ means
in thread What does !$saw{$_}++ means

With no change to the idiom, I'd write that as,
my %saw; my @out = grep { ! $saw{$_}++ } @in;
But that extends the lifetime of %saw. If later in the same (or an inner) block, you need to use the same construct, you have to use a different name for the hash, or do a %saw = () - which will then cause errors if you remove the first construct (until you my the newer construct).

I like to write it as:

my @out = do {my %saw; grep !$saw{$_}++, @in};
which doesn't leak the name of the temporary array.