while(<>) { my $line = /\S/ ... /^$/; print "$line:$_" if $line && $line!~/E0$/; }