foreach (@words) { $word_idx{lc($_)} = $position; }