At 13.17 -0400 1999.04.15, Doug McNutt wrote: ># Illegal character \012 (carriage return). >I'll just keep the linefeeds in my source code and make up a simple MPW menu >item to install them each time I save the file. That way my scripts will >transfer anywhere. > >Surely the <0A> character is whitespace which will be ignored by the MacPerl >parser. Either the <0A> or the <0D> will terminate the lines. Well, the other day I went over how perl5.005 is just now becoming agnostic to different newlines. Whitespace sometimes does matter. Consider this: #!perl -w print 1; If this has \012 as newline, and I run it on a Mac, I would get nothing, because everything is on one line, and that line has a # in front of it (or in this case, a #!, which is different still, being on the first line). >Nope.. Screwed again, but this time by MacPerl and not by perl in general. Nope. Read on. >Now my ASCII crib sheet says \012 (octal) = 0A (hex) = 10 (dec) = >"linefeed". What's this "carriage return" stuff? Is this a hard-coded error >message which assumes perl is running on a UNIX box in English? Pretty much. If you had run it on Unix with MacPerl newlines, it would be the same error, except it would say \015 instead of \012. See perldiag.pod, and search for "Illegal character". >If the parser takes the time and core to remind me that I didn't strip off >the junk then just why can't it just ignore it? Note that the -w switch was >OFF. perldiag.pod explains this. It was a deliberate design decision by the perl porters, and not something unique to MacPerl. However, once we get perl (not just MacPerl!) reading \012, \015\012, or \015 as newlines in programs, libraries, modules, etc., this problem will go away. It already has gone away (from what I can tell) for Unix and DOS newlines on those machines, and any machine that recognizes \n as LF and \r as CR. I am not convinced that it has gone away for Macs (even though, of course, perl5.005 is not running on Mac OS yet). That's because perl's toke.c uses \n and \r. This made sense before, when \n was local newline. Now that we are differentiating between specific values, I fear this will not work unless we check for \n, \r, \n\r, and \r\n. Yay. -- Chris Nandor mailto:pudge@pobox.com http://pudge.net/ %PGPKey = ('B76E72AD', [1024, '0824090B CE73CA10 1FF77F13 8180B6B6']) ===== Want to unsubscribe from this list? ===== Send mail with body "unsubscribe" to macperl-request@macperl.org