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

Re: [MacPerl] How files are read in - followup



At 13.59 -0000 98-12-30, G. Ann Campbell wrote:
>I do want to ask about $/, though.
>In MacPerl, it's normally "/r"?

Weeell, no. The newline character is different in Mac OS, Unix and
(Win)DOS. In Mac OS it's CR (carriage return), in Unix it's LF (line feed)
and in DOS the're using CR followed by an LF, just for sure.

However, when you transfer files back and forth with FTP, these line
endings are  converted automatically by your FTP program, and you wont have
to worry about it.

To further minimize the needed amount of worrying, Matthias has made
MacPerl match \n with CR (instead of with LF as in Unix) That way, we can
just use \n in our scripts, and the'll work. Gee, we can even download
programs written for Unix, use them on ordinary Mac OS text files, and
they'll work!

It wont get any more complicated until you want to deal with non-native
line endings, like LFs on (they're spelled \r). Otherwise, use \n to mean
"line ending", and let your FTP program translate the actual line endings
for you.

>P.S. to Bart: Sorry 'bout the VCARD crud. I agree, but my boss likes 'em and I
>forget they're there.

I'm glad you removed them, though.

/Cajo.

___Carl_Johan_Berglund_________________________
   Adverb Information
   carl.johan.berglund@adverb.se
   http://www.adverb.se/



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