>>923 Perl5

@a = qw{-6 3 9 5 3 -7};
$h{$_}=1 for @a;
%o = map{$_=>++$i} sort{$a<=>$b} keys %h;
@b = map{$o{$_}} @a;
print "@a => @b\n";

実行
~ $ perl 13_920.pl
-6 3 9 5 3 -7 => 2 3 5 4 3 1