develooper Front page | perl.perl5.porters | Postings from April 2010

Re: Perldoc: Bad way to spell a cat (perlrequick)

Thread Previous
From:
David Tylski
Date:
April 13, 2010 09:14
Subject:
Re: Perldoc: Bad way to spell a cat (perlrequick)
Message ID:
4BC498FE.6020909@parrot.com
Hmm okay, was persuaded octal sequences were all beginning with \0...
Sorry :-)

Le 13/04/2010 18:11, Zefram a écrit :
> David Tylski wrote:
>    
>>      "cat"        =~ /\143\x61\x74/ # matches, but a weird way to spell cat
>> This does not match in ASCII, probably a double typo.
>>      
> $ perl -lwe 'print "cat" =~ /\143\x61\x74/'
> 1
>
> Octal 143 *is* hex 63, which is ASCII "c".
>
> -zefram
>    

Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About