Do not have to write in a C style loop. If  you need to know the column number , should write in the following way:

for my $i (0..scalar @$all_strains) {
  my $strain = @$all_strains[$i];
}


http://modernperlbooks.com/books/modern_perl_2014/03-perl-language.html#YnVpbHRpbnM7Zm9y2