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

[MacPerl] Re: Newlines



At 9:26 PM -0400 10/12/97, Richard Rathe wrote:
>On 10/12/97 Mark F. Murphy wrote:
>
>>>Just what you said, convert it to Mac CR (\015) instead of UNIX LF (\012).
>>>Most text editors do this, along with gobs of other utilities, and you can
>>>make a MacPerl droplet to do it as well:
>>
>>Well... I was hoping I didn't have to translate the files first.  I was
>>kinda hoping MacPerl would work with either transparently.
>
>I still find it amazing that Perl is non-portable BY DESIGN!?! The concept
>of end-of-line is so universal, I fail to understand why this problem isn't
>"taken care of" behind the scenes...

Exactly!

Finally someone sees what I'm talking about.

I guess I wasn't clear enough in stating that I *do not* want to translate
the files, or run them from a server, or have my FTP (or Net Finder) do the
translation as a download.

I am porting a commercial Perl product of mine to the Mac (since the Mac is
my first love).  It is not desirable (though I'll do it if I have to) to
*have* to convert my source (which is a lot of modules) to CRs from NLs.

Seeing how many Perl scripts come from the Unix world, I would have thought
it would have been a design advantage for MacPerl to sense the file has
Unix NLs and work anyway.

BBEdit knows what the EOL char is and does the right thing... why not
MacPerl?  After all, the Mac is all about the user not having to know these
things and the application should just do the right thing.

>From a programming standpoint, I don't see how it would be too big of an issue.

The only caveat I can think of is if a Perl script itself has to read a
file in a binary mode.... it would have to deal with such an issue.
Hopefully the built in Perl functions for reading in lines (and reg exp)
would also work in a trasnparent way.... otherwise, I may have a lot of
work to do in porting this to the Mac (I already have a DR for the Mac
under WebTen, but that doesn't count because WebTen is really BSD Unix
running Apache).

>Don't get me wrong, I like Perl and I think MacPerl is a godsend. This is a
>question, not a flame. <smile>

Exactly.

>PS to Matthias: Maybe the MacPerl editor could prompt the user and then
>convert text files brought over from UNIX and that 'other' OS....

For me, this still would not be good.  I'm porting a product from Unix that
I'd like the scripts to just *work*.  If the file *must* to be converted,
I'll just use BBEdit or write some batch process to do the trick.  :(

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