while () { if (my $ln = /bar/ .. /baz/) { print unless $ln =~ /E/; } }