in reply to Re: processing text from flat file
in thread processing text from flat file

Don't go mucking around with special global vars w/o localizing them first (at least, not when giving advice to others)! Even if it doesn't make much of a difference in this small script, it is a bad habit to get into and *will* come back to bite in a longer program.
#!/bin/perl -w use strict; { local $/="|--------------------------------------|\n"; while( <DATA>) { [SNIP] } [SNIP] } ### Here in the program, the <FH> operator will now behave normally ### Before you could have been burned, since any other calls ### to <FH> would see the specialized value of $/, even calls ### in subroutines. As you can imagine, this is a pain to debug ### Its best to avoid this trap altogether as I have done above.
Update: Added parenthetical clarification....

-Blake