my $interesting_bit; { # maybe open here . . . local $/ = '--start foo--' . "\n"; $interesting_bit = ; local $/ = '--end foo--' . "\n"; $interesting_bit = ; # . . . and close here }