while (@array) { my $val = shift @array; # do something with $val } #### while (my $val = shift @array) { # ... } #### if (length $string) { # ... } #### open my $fh, "<", $file or die "failed to open $file $!"; #### $error_count++ and next if some_condition(); #### ++$error_count and next if some_condition();