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

Re: [MacPerl] Executing MacPerl script on a PeeCee



At 07.41 -0400 1999.04.13, Arved Sandstrom wrote:
>On Mon, 12 Apr 1999, Doug McNutt wrote:
>> Also: I had placed a test for the "MacOS" in my script and changed to "\r\n"
>> for the line terminator in my output files. That's wrong. Apparently perl on
>> the PeeCee puts out the right thing when you simply specify \n. That means
>> \n is the right terminator to use for output for all three systems. Just why
>> the perl parser doesn't recognize all three, as does M$Word, is a mystery
>> beyond my simple mind.
>>
>Perl on *every* OS puts out the right thing when you output \n, which is
>the logical newline for the operating system.
>
>What you're saying, though, is that you expect Perl to recognise \xA, \xD
>or \xD\xA as line-ends on any system. Why? On Unix it's \xA, on Macs it's
>\xD, and on Windows (theoretically, although I've seen evidence to the
>contrary) it's the combo.

The skinny is that perl 5.005 (though it was buggy, and is now working
properly in 5.003, apparently) will parse perl programs and modules that
use \012 or \015\012 (or "\xA or \xD\xA" for Arved ;) as their newlines.
It still will not parse files with the Mac newline, \015.  While I am not a
decent C programmer, it has been on my list to look into fixing this in
toke.c (but if someone else wants to do it, go right ahead).

The docs in perl5.005 say that any if \012, \015, or \015\012 will work.
This isn't true, and was never true, and wasn't supposed to be true.  It
was only planned by the implementers to be for \012 and \015\012.  But they
are certainly open to patches to make it work with \015.

Does that make sense?  :)

--
Chris Nandor          mailto:pudge@pobox.com         http://pudge.net/
%PGPKey = ('B76E72AD', [1024, '0824090B CE73CA10  1FF77F13 8180B6B6'])

===== Want to unsubscribe from this list?
===== Send mail with body "unsubscribe" to macperl-request@macperl.org