>>490

my $count;
my %temp = map { $_, $count ++ } @array;
@result = @temp{grep { /an/ } @array};

こんな感じかなー。インクリメントのあたりが怪しいけど。