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

[MacPerl] Re: Newlines



At 5:28 PM -0400 10/12/97, Chris Nandor wrote:
>At 16.47 10/12/97, Mark F. Murphy wrote:
>>Well... I was hoping I didn't have to translate the files first.  I was
>>kinda hoping MacPerl would work with either transparently.
>
>Nope.  This isn't a good idea.  What if you wanted embedded \012
>characters in your MacPerl script?  It would get changed to \015 whenever
>you ran it.  That would be bad.  Even with the sample script I gave you,
>that is a danger to watch out for.  This is simply a fact of life when
>dealing with cross-platform text files.

Simple....

One uses the backslash.... as in...

print "Hello World\n";
print "Hello World\r";

The embedded control chars at the end are not EOLs as far as the file is
concerned.  CR, LF, or CRLF can easily be identified as the EOL.

It's also not a matter of translating... it's a matter of MacPerl
recognizing the file's EOL char.

By having to translate the text file to Mac first, I now have to maintain
two sets of scripts.... one for Unix and one for Mac.

mark

PowerPerl(tm),  mailto:info@powerperl.com   http://www.powerperl.com
       A product of Tyrell Software Corp.   http://www.tyrell.com



***** Want to unsubscribe from this list?
***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch