in reply to Scanning a list for indices
my @indices = grep { my $i = $_; grep $a1[ $i ] eq $_, @a2 } 0 .. $#a1 +; [download]