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

Re: [MacPerl] tab-return characters



kamma@iname.com (kamma@iname.com) wrote:

>how do I match a 'tab-return' character.  In the unix world,  I've been
>doing this by telling perl to look for '\003' like
>
>$text =~ s/\003/HI/g;
>
>I have a file with embedded tab-return characters that I want to
>translate.  Other stuff works fine like '\015' for returns and '\030'
>for
>spaces but for some reason it just skips over the '\003'.
>
> is there a macperl equilvalent or does this have more to do with the
>mac environment?

Um, it works for me... 

    $a = "xxx\003===\003yyy";   # string with embedded \003 chars
    print "before: a = ", $a, " length = " , length($a), "\n";
    $a =~ s/\003/¥/g;   # transform \003 chars into something else
    print "after:  a = ", $a, " length = " , length($a), "\n";

yields...

    before: a = xxx===yyy length = 11
    after:  a = xxx¥===¥yyy length = 11


But isn't \003 equal to control-C?  I've never seen it used for 
tab-return, whatever that is.  Not that I've looked too hard, however.

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