use List::MoreUtils qw(first_index); my $index = first_index{ $_ eq $suchwort }@array;