Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Recursive substitution

by ikegami (Pope)
on Nov 10, 2009 at 04:39 UTC ( #806123=note: print w/replies, xml ) Need Help??


in reply to Recursive substitution

if it can be done entirely inside the regex itself;

If what can be done? Change the position at which it will continue matching? Why don't you try it?

>perl -le"$_='abc'; /(.)(?{ pos = 0 })(.)/; print for $1,$2" a b

Guess not.

Replies are listed 'Best First'.
Re^2: Recursive substitution
by JadeNB (Chaplain) on Nov 10, 2009 at 12:15 UTC
    As indicated in my post (even the first version, not one updated out from under you—sorry), I did try modifying pos, to (as you point out) no avail. My question was just whether there was some other clever approach that I was missing.

      I did try modifying pos

      Yes, but not within the regex. Whatever it is you want to do, you said you wanted to do it within a regex.

      My question was just whether there was some other clever approach that I was missing.

      Again, another approach to do what?

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://806123]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (9)
As of 2020-09-18 13:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    If at first I donít succeed, I Ö










    Results (112 votes). Check out past polls.

    Notices?