in reply to Re: Implementing variable-width negative lookbehind assertions?
in thread Implementing variable-width negative lookbehind assertions?

Interesting. The subroutine only gets compiled once but the regex gets compiled once for each closure created. That was a surprise to me at first but then the regex can't be compiled when the subroutine gets compiled ($pat isn't set then) so it gets compiled when it is first used (or is it actually compiled when the closure is created?)...

I thought that the regex state was attached to a node in the parse tree and I'd expect the closures to all be sharing the same node for that regex...

Care to go into more detail on why/how this works? Was this regex/closure interaction specifically implemented or did it fall out of the general design?

        - tye (but my friends call me "Tye")
  • Comment on (tye)Re: Implementing variable-width negative lookbehind assertions?