Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: How do I handle mid-line carriage returns in a flatfile database?

by Anonymous Monk
on Dec 30, 2000 at 05:33 UTC ( [id://48949]=note: print w/replies, xml ) Need Help??


in reply to How do I handle mid-line carriage returns in a flatfile database?

There's a whole bunch of stuff in the FAQ about matching over more than one line, like the /s modifier for the end of a regular expression, which means "the stuff you find doesn't have to be on the same line".

It also say that if you set $/ = '' then Perl will read in paragraphs at a time, not lines at a time.

Does that help?

But obviously, killing the carriage returns on the way in to your program is going to solve it. The equivalent to the $/ = '' thing above is surely to

* replace all double returns with a holding pattern like ||||

* replace all single returns with spaces

* replace all |||| with returns

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://48949]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (3)
As of 2024-03-29 14:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found