[Israel.pm] (no subject)

Gabor Szabo szabgab at gmail.com
Thu Mar 16 07:17:10 PST 2006


On 3/16/06, Levenglick Dov-RM07994 <Dov at freescale.com> wrote:
> 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:

still you have to use $10 in the replacement part.
\10 refers to the buffer only in the regex part.

perl5.8.7 -e '$a="1.2.3.4.5.6.7.8.9.20";$a=~s/(\w+)\.(\w+)\.(\w+)\.(\w+)\.(\w+)\.(\w+)\.(\w+)\.(\w+)\.(\w+)\.(\w+)/$10/;print
"$a\n"'

prints 20

Gabor




More information about the Perl mailing list