http://qs321.pair.com?node_id=349159

perlcgi has asked for the wisdom of the Perl Monks concerning the following question:

I'm processing very large text files of delimited records, and localizing $/ to be my delimiter works great.
{local $/ = "DELIMITER"; while( <FILE> ){ do_this(); do_that(); do_the_other(); } }
However, I don't like having $/ altered for the scope of the entire while-loop 'cos that's pretty much my whole program and it could have consequences for the subroutines within the loop. I'm seeking a nice idiom to return it to its previous value, after it has done it's thing, for each iteration. Suggestions much appreciated.