in reply to Re: Regular Expressions: Call for Examples
in thread Regular Expressions: Call for Examples

There's no re-entry here. The regex engine has exited once the regex portion of the s/// ends. Once the right-hand side of the substitution is done, the regex engine starts again; it is not paused, though, it has stopped. Compare: "japhy" =~ m{.(?{ "perlmonk" =~ /./ }).}; Watch it explode.

_____________________________________________________
Jeff[japhy]Pinyan: Perl, regex, and perl hacker, who'd like a job (NYC-area)
s++=END;++y(;-P)}y js++=;shajsj<++y(p-q)}?print:??;

Replies are listed 'Best First'.
Re: Regular Expressions: Call for Examples
by Abigail-II (Bishop) on Jul 22, 2002 at 14:49 UTC
    That segfaults for me on 5.005_03, and 5.6.0, but not on 5.6.1 or 5.8.0. It seems to be fixed between 5.7.0 and 5.7.1. The former segfaults, the latter doesn't.

    Abigail

      It died on my 5.6.1, but no matter -- just introduce some $1 in there, and it breaks on everything I have (5.8 included):
      "japhy" =~ m{ ( . (?{ "perl" =~ /(.)/; print $1 }) . ) (?{ print $1 }) }x

      _____________________________________________________
      Jeff[japhy]Pinyan: Perl, regex, and perl hacker, who'd like a job (NYC-area)
      s++=END;++y(;-P)}y js++=;shajsj<++y(p-q)}?print:??;