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

Re: [MacPerl] escape oddities...



<x-flowed>At 13:32 -0500 2/9/99, Scott Prince wrote:
> on 2/8/99 10:31 AM, Chris Nandor wrote...
>>No.  MacPerl sees \cM as \n, and \cJ as \r.  Unix and Windows do the
>>opposite.
>
> \cM, \cJ? I have rarely seen these. Just out curiosity, where could I
> find a list of every possible escape sequence recognized by Perl?

At 13:53 -0500 2/9/99, Chris Nandor wrote:
> \cM means carriage return, \cJ means linefeed.  There is no list of every
> possible sequence, really, unless you have a list of all octal and hex
> sequences.  And Unicode is around the corner, which adds more.

To take it back one step further, \c is "control-" (c.f. Camel, p. 65)

   A backslashed c followed by a single character, such as \cD, matches
   the corresponding control character

So you don't "see" \cM; \cM is a pattern which matches the ASCII 
control character often shown as ctl-M or ^M or \015.  It's a 
non-ambiguous way of describing the character.

\r and \n are, unfortunately, ambiguous.  They describe the behaviour 
but not the underlying control-character sequence.  \n is a "newline" 
which has a different control sequence implementation depending on 
whether we're talking about Mac or Unix (MacPerl or Code Warrior). 
So it's best to stick with the actual character in the data than to 
discuss the higher-level "meta" character.

Better?  Worse?

- Vicki
---
      |\      _,,,---,,_       Vicki Brown <vlb@cfcl.com>
ZZZzz /,`.-'`'    -.  ;-;;,_   Journeyman Sourceror: Scripts & Philtres
     |,4-  ) )-,_. ,\ (  `'-'  P.O. Box 1269  San Bruno  CA  94066
    '---''(_/--'  `-'\_)       http://www.cfcl.com/~vlb  www.ptf.com/macperl

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


</x-flowed>