in reply to Re^3: Explain the code
in thread Explain the code

Noticed the ++ in !$seen{$_}++?

perl -MData::Dumper -e '@a=(1, 2, 1, 2, 3); my @result = grep { !$seen +{$_}++ } @a; print Dumper(\%seen);' $VAR1 = { '1' => 2, '3' => 1, '2' => 2 };