[Kc] return vs newline

Andrew Moore amoore at mooresystems.com
Thu Dec 7 09:13:45 PST 2006


On Thu, Dec 07, 2006 at 10:40:20AM -0600, JYOUNG79 at kc.rr.com wrote:
> Hi,
> 
> I'm trying to loop thru paragraphs in a file but evidently the file has 
> carriage returns instead of newlines so when perl reads it in, it reads 
> it in as one big line instead of separate paragraphs.  Does anyone know 
> if there's a way to have perl use carriage returns instead so I can 
> loop thru each paragraph one at a time?

Hi Jay -

I'm not sure I actually caught the difference between what you're
considering "lines" versus "paragraphs", but here's my best shot:

You can read about what affects this behavior under the
"$INPUT_RECORD_SEPARATOR" heading in the perlvar perldoc. Also, check
out the "Newlines" bit in perlport.

But, I'm guessing that there's something else more simple going on
here. Could you post a small sample of your code that fails to do what
you expect, please?

-Andy




More information about the kc mailing list