for (my $count = 0; $count < scalar(@bar); $count++) { printf "%d -> %s\n", ($count, $bar[$count]); }