foreach my $base_p4path (@array) { # Execute once for each element in @array. # Hence *NO* loop iteration if @array is empty. }