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;
In reply to Re: How to Test if Two Arrays are Ordered in the Same Way
by jdhedden
in thread How to Test if Two Arrays are Ordered in the Same Way
by monkfan
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |