foreach my $record (@records) { # Do stuff with $record } #### for(;$index<@records;$index++) { # Do stuff with $records[$index] }