Your skill will accomplish what the force of many cannot |
|
PerlMonks |
(boo) Re: Replacing a given character starting with the xth occurence in a stringby boo_radley (Parson) |
on May 21, 2001 at 19:24 UTC ( [id://81990]=note: print w/replies, xml ) | Need Help?? |
I love all of the answers to this question, especially ZZamboni's, satchmet's and tachyon's. I went over and said to @coworker, "lookie this!", and they replied "what the hell does that do?" I explained what the topic was. $coworker[1] says "ah, that's faboo, but how does it do it?" and it took me about 5 minutes to puzzle through ZZamboni's. He explained that the idea's useful, but the implementation was a bit opaque for him. We chatted for a few more, and then I suggested the following, which is a much different take. I don't suggest that this may be a faster implementation, or a better one, but for those that I showed, it's more understandable. I'm not knocking anyone's reg-fu, of course, but even some basic concepts like ?: confound some, and I wanted to show TIMTOWTDI.
on a related subject, isn't this concept called lookbehind, as in the owl, pg 229 and 230?
In Section
Seekers of Perl Wisdom
|
|