while (my ($index, $value) = each @a) {
   say "$index $value";
}
0 a
1 b
2 c