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

Re: [MacPerl] Reading PC files



On Thu, 23 Jul 1998 09:54:37 -0400, William B. Birkett wrote:

>Now I need to process files that originate on PC's.

I do that all the time. The trick I use is that I only look for CR
("\n"), and simply delete any newlines, like this:

=09while(<>) {
=09=09tr/\r//d;
=09=09... # do what you want
=09}

This one treats PC and Mac files as equivalent. I can't say I notice any
speed loss. It doesn't work for Unix files, though...

p.s. There are other differences between Mac files and PC files, too:
the "accented characters" (Ascii code above 128) are different. But they
differ between DOS and Windows, too. In plain English, this difference
is irrelevant.

=09Bart.

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