"TC" == Tom Christiansen [EMAIL PROTECTED] writes:
$`, $ and $' are useful variables which are never used by any
experienced Perl hacker since they have well known problems with
efficiency.
TC That's hardly true. I could show you plenty of code from
TC inexperienced Perl hackers
those early perl3 scripts by lwall floating around in /etc were poorly
written. i am glad they are finally out of the distribution.
Those weren't the scripts I was thinking about, and it is *NOT*
ipso facto true that something which uses $ or $` is poorly
written.
--tom
Nat wrote:
5.6's regular expressions have (??{ ... }) to permit recursion and
$^R to maintain state through the parsing.
In another thread, Tomc wrote:
[...] Likewise the @+ and @- stuff.
Okay, I'm throwing my ignorance out for the whole world to see. WTF??
Sure, I'm not in the loop, as
Tom Christiansen wrote:
There's also long been talk/thought about making $ and $1
and friends magic aliases into the original string, which would
save that cost.
I was distressed to discover that s///g does not rebuild the
old string between matches, but only at the end. It broke my
random
All in all, though, you're right that neither set of features is particularly
well-known/used outside of p5p followers. At least from what I've seen.
Virtually every person I've worked with since 5.6 came out has been surprised
and amazed at the REx eval stuff.
The completely reworked regex
Please correct me if I'm mistaken, but I believe that that's the way
they are implemented now. A regex match populates the -startp and
-endp parts of the regex structure, and the elements of these items
are byte offsets into the original string.
I haven't looked at it at all, and
[cc'ed to -regex b/c this is related to RFC 138]
Proposed replacements for m// and s///:
match /pattern/flags, $string
subst /pattern/newpattern/flags, $string
The more I look at that, the more I like it. Very consistent with split
and join. You can now potentially match on