while () { next if ! /\S/; chomp; process_stuff( $_ ); } #### while () { chomp if /\S/; process_stuff( $_ ); } #### Yours: $line =~ /^$/ or chomp ( $line ); Mine: chomp $line if $line =~ /\S/;