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

Re: [MacPerl] When is \r really \n in MacPerl!?



At 2:49 PM +0000 2/12/98, Jon Warbrick wrote:
>Out of interest, if you believe \n to be well defined than what would
>you expect it to
>                 print
>                       in
>                          MS-DOS
>                                 Perl?

I don't have to *expect*... I can tell you.

Here's the test script:


#!/usr/bin/perl5

# Be strict
use strict;

print 'Ord \r: ' .ord("\r") . "\n";
print 'Ord \n: ' .ord("\n") . "\n";


Here's the output for MacPerl 5.1.5r4 (script uses Mac line endings):

Ord \r: 10
Ord \n: 13

Here's the output for Perl for Win32 Build 110 (script uses either Unix or
DOS line endings):

Ord \r: 13
Ord \n: 10

Here's the output for for Perl for BSDI (script uses Unix line endings):

Ord \r: 13
Ord \n: 10


How perl outputs to a terminal device (i.e. MacPerl's output text window)
should be abstracted in my opinion.

Personally, my goal for perl on the Mac is for as much parity with perl on
Unix and Win as possible.  To me, this means besting even DOS and allowing
for perl scripts on the Mac with either Mac, Unix, or DOS line endings.  It
also means keeping \r as 0x0D and \n as 0x0A.

This is not a "holy quest" for me... it's just a comment on a design issue.
Let's not get religion about this.

mark

---------------------------------------------------------------------------
 Mark F. Murphy, Director Software Development   <mailto:markm@tyrell.com>
 Tyrell Software Corp                            <http://www.tyrell.com>
 PowerPerl(tm), Add Power To Your Webpage!       <http://www.powerperl.com>
---------------------------------------------------------------------------
Member of Families Against Internet Censorship: rainbow.rmi.net/~fagin/faic



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