C.R. am Mittwoch, 25. Oktober 2006 20:38: > Well, that kinda worked. I had to change it to work on a scalar so this > is what I wrote: > $s=~s/(\d+ +cm)/<bx;1>$1<ba>/g; > > Input string: 144 cm > Output string: <bx;1>14<bx;1>4 cm<ba><ba> > > Why did I get duplicate <bx;1> and <ba> strings?
Hm, I can't reproduce this (perl 5.8.8): $ perl -le 'my $s=q(144 cm); $s=~s/(\d+ +cm)/<bx;1>$1<ba>/g; print $s;' <bx;1>144 cm<ba> What exactly did you do? > Is the \G operator here ? > and does v5.6.1 have it? Don't remember, sorry. Dani -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>
