Dealing with EOL chars

Nicholas Clark nick at ccl4.org
Thu Jan 24 16:47:40 GMT 2008


On Thu, Jan 24, 2008 at 10:30:48AM -0500, Alex Brelsfoard wrote:

> Does this make a bit more sense?

Yes.

> btw, there's no chance that I could define $/ as a regex is there?

No. Not in Perl 5. (And implementation wise it would be hard to change this)
I believe that Perl 6 is intending to offer this.

Of course, you can slurp the entire file into memory and then use a regexp to
split it, so if you have enough RAM (or swap), you can fake it.

The alternative it to stick lines back together when you discover that the
line you have is actually only a partial record because it terminates within
a quoting construction.

Nicholas Clark


More information about the london.pm mailing list