in reply to How to Test if Two Arrays are Ordered in the Same Way
You have to take into account the elements order with respect to each other. In this case, pos1 <= pos2 <= pos3 ...my $decision = grep($h{$$ar2[$_-1]} > $h{$$ar2[$_]}, 1..$#{$ar2}) +? 0 : 1;
|
|---|