in reply to Re: Re: Re: Cannot read in multiple lines
in thread Cannot read in multiple lines

Enlil quoth
I would guess that at some point you assigned $\ a new value, or perhaps undefined it. If you need this you should put it in a block and localize the assignment, like so: ...

Surely you mean $/ not $\. $/ is INPUT_RECORD_SEPARATOR while $\ is OUTPUT_RECORD_SEPARATOR according to perlvar

Other than that - it looks like excellent advice.

One other possibility is that the input file has been produced by a computer with different line characteristsics. E.g. A windows PC reading a file creted by a Unix program will also do precisely what you are experiencing. In which case setting $/ to be the very specific chr(13) woule be a good idea.

Dingus

  • Comment on Re: Re: Re: Re: Cannot read in multiple lines