perldl> p $a=sequence(5) [0 1 2 3 4] perldl> p $b=pdl(1,4,9,9,16) [1 4 9 9 16] **** To get the index of values in $a that can be found anywhere in $b: perldl> $d=which(maximum (($a==$b->dummy)->xchg(0,1))!=0) perldl> p $d [1 4]