Somewhat simpler version:
my( $n, %h ) = -1; my @a = map{ $h{$_} //= $n+=2 } qw[ M94202 M94150 M94297 M94150 M94161 + M94161 M94162 ];; print @a;; 1 3 5 3 7 7 9
In reply to Re: Replacing values in an array
by BrowserUk
in thread Replacing values in an array
by tonto
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |