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

Re: [MacPerl] Re: Problems installing Mac Glue



On Mon, 27 Dec 1999, John Delacour wrote:

> Alpha seems a very nice editor for working with Perl, but I seem to be
> having a problem with carriage returns (reported as such but with code
> /012) and the Apple Events Alpha is using.  Taking the text from a
> script that works well in the Perl editor and pasting it into Alpha to
> run it, I get the error reported that "I may have got the file over a
> network and not converted the line endings" or something like that.  No
> matter what I do, even if there is not a cr or a char 12 in sight and
> even if I save the Perl document and open it in Alpha, I can't get rid
> of this error.

A \012 is actually a linefeed, to be pedantic. This is a UNIX end-of-line
(EOL). A Mac EOL is \015, or 0x0D or dec. 13. This latter is a
carriage-return; \012 or 0x0A or dec. 10 is a newline.

Alpha reports the line-ending type in the lower-right of the bottom status
bar. To convert, use Save As, and select from Mac, Unix, or IBM. This
means you'll answer Yes to Replace File?

If you want to check a file, the Search in Alpha understands \n for Unix
EOL and \r for Mac end-of-line.

Also, be advised (because this can otherwise bite you) that \n in *Perl*
is OS-specific line-ending.

This is about the grossest stuff that any of us will ever run into - you
are not alone. It's so unnecessary. :-) I've been looking at XML modules
in MacPython, the last couple of weeks, and I've been beating my brains
out with precisely these issues. For what it's worth, Perl development is
addressing (has addressed? Chris?) this issue.

Arved Sandstrom



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