in reply to Re: Is there a default array for reg exp memory variables?
in thread Is there a default array for reg exp memory variables?

I located the concept named capture buffers five minutes ago, then I go over here and see that you have already posted code using it and Eliya has also provided great feedback. Thanks! Virtual beer for both of you!

I just haven't seen reg exps in list context in enough examples or code to actually realize its power until I stumbled across it in Effective Perl Programming. I agree it is the way to go but I still think we could have use for a named default array. Is there a reason for not having it in there?

  • Comment on Re^2: Is there a default array for reg exp memory variables?

Replies are listed 'Best First'.
Re^3: Is there a default array for reg exp memory variables?
by BrowserUk (Patriarch) on Feb 05, 2012 at 23:11 UTC
    but I still think we could have use for a named default array. Is there a reason for not having it in there?

    One reason: If it existed, the safest thing to do would be to copy it into your own array to ensure that the data it contained didn't get overwritten by a subsequent regex invocation before you were finished with it.

    What would be the point of the global default array if the only thing you could safely do with it is copy it to somewhere else, when you can assign the results directly to that other place?


    With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.

    The start of some sanity?