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 };
In reply to Re^4: Explain the code
by olus
in thread Explain the code
by rose
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |