$w = 1; while ($w <= @word_search) { # uses $w - 1 to get $word_search[$w - 1] $w++; }