Help for this page
use strict; use warnings; ... my ( $n, %h ) = -1; $_ = $h{$_} //= $n+=2 for @a; print Dumper \@a;
my ( $n, %h ) = -1; $_ = $h{$_} //= $n+=2 for @a;
$_=$h{$_}//=$}+=2-!$}for@a;