in reply to Re^4: Can you do "conjunctive" (overlapping) conditions in a single regexp?
in thread Can you do "conjunctive" (overlapping) conditions in a single regexp?

Oops, Re: Extracting the number of repetitions from a regex pointed out that lexicals don't work right in those code blocks. You need to make the hashes global or else the second time through you could have bad information from the first one.

That means use our instead of my.

  • Comment on Re^5: Can you do "conjunctive" (overlapping) conditions in a single regexp?

Replies are listed 'Best First'.
Re^6: Can you do "conjunctive" (overlapping) conditions in a single regexp?
by ikegami (Patriarch) on Dec 18, 2008 at 19:41 UTC

    Lexical variables work fine if they're declared in the block. If they're declared outside the block, the block becomes a closure.

    I wouldn't use a bare our, though. I use local our. See the first post in this thread for an example.