[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] line separators



Bart Lateur <bart.mediamind@tornado.be> writes:
>Chris Nandor wrote:
>
>> MOST modules can be installed in this manner:
>> 
>> 1.)  Make sure linebreaks are converted from UNIX to Mac.
>
> Just a thought. Wouldn't porting Perl code from Unix to the Mac be a lot
> easier, if we wouldn't have to worry about such mondane things like a line
> terminator?

> For this to be realized, MacPerl "only" would only need to treat 
> /\015\012|\015|\012/ on a multiline pattern match, as a valid line separator
> for it's scripts.

This proposal would be quite difficult to implement, as it would require an
extension of $/ to regexps.

However, I suggested a different scheme to Perl5-Porters:

 - To introduce an operator -N that would, analogously to -B and -T, scan
   the stdio buffer for the line terminator used in the current file.
 - Adding an implicit $/ = -N; at the beginning of processing of each script.

Reception was less than enthusiastic, but I suppose I will bring it up again
once 5.004 is out the door.

Matthias

-----
Matthias Neeracher   <neeri@iis.ee.ethz.ch>   http://www.iis.ee.ethz.ch/~neeri
   "I'm set free to find a new illusion" -- Velvet Underground