for my $id (0..$#Genres) { $Genres{ lc($Genres->[$id]) } = $id; } # for