[Israel.pm] (no subject)

Levenglick Dov-RM07994 Dov at freescale.com
Thu Mar 16 06:59:21 PST 2006


Actually it is because that is what it is supposed to do. What I had really wanted to ask is why this:
perl5.8.7 -e '$a="1.2.3.4.5.6.7.8.9.10";$a=~s/(\w+)\.(\w+)\.(\w+)\.(\w+)\.(\w+)\.(\w+)\.(\w+)\.(\w+)\.(\w+)\.(\w+)/\10/;print $a'

doesn't print anything when the camel book states:
"For two- and three-digit backreference numbers, there is some ambiguity with octal character notation, but that is neatly solved by considering how many captured patterns are available. For instance, if Perl sees a \11 metasymbol, it's equivalent to $11 only if there are at least 11 substrings captured earlier in the pattern. Otherwise, it's equivalent to \011, that is, a tab character."
 
Best Regards,
Dov Levenglick
DSP SoC System and Applications Engineer,
Network and Computing Systems Group
Freescale Semiconductor Israel
Tel. +972-9-952-2804
The information contained in this email is classified as:
[ ] General Business Information
[ ] Freescale Internal Use Only
[ ] Freescale Confidential Propriety
[x] Personal Memorandum
 

-----Original Message-----
From: perl-bounces at perl.org.il [mailto:perl-bounces at perl.org.il] On Behalf Of Gabor Szabo
Sent: Thursday, March 16, 2006 4:55 PM
To: Perl in Israel
Subject: Re: [Israel.pm] (no subject)

On 3/16/06, Levenglick Dov-RM07994 <Dov at freescale.com> wrote:
> perl5.8.7 -e '$a="1.2.3.4.5.6.7.8.9.10";$a=~s/(\w+)\.(\w+)\.(\w+)\.(\w+)\.(\w+)\.(\w+)\.(\w+)\.(\w+)\.(\w+)\./\9/;print $a'
> Produces: 910
>
> Why?

because you used \9 instead if $9 in the substitute
Gabor

>
> (It is also the case when running 5.6.1)

_______________________________________________
Perl mailing list
Perl at perl.org.il
http://perl.org.il/mailman/listinfo/perl



More information about the Perl mailing list