LINE: while () { next LINE while /Foo/ .. /Bar/; chomp; # Do stuff here. }