for my $file (@files) { # Perl will exit the loop when the array has been processed }