http://qs321.pair.com?node_id=617538

imp has asked for the wisdom of the Perl Monks concerning the following question:

I was revisiting Negating Regexes: Tips, Tools, And Tricks Of The Trade and caused perl to segfault with one of the patterns I tried. I reduced the pattern to he simplest form that still causes a problem. Tested with:
This is perl, v5.8.7 built for i486-linux-gnu-thread-multi Characteristics of this binary (from libperl): Compile-time options: MULTIPLICITY USE_ITHREADS USE_LARGE_FILES PERL_IMPLICIT_CONTEXT

This works:

"1" =~ qr[(??{/^1/})]
This segfaults
"<" =~ qr[(??{/^</})]
Segfault re=debug output:
Freeing REx: `","' Compiling REx `(??{/^</})' size 4 Got 36 bytes for offset annotations. Compiling REx `^<' size 4 Got 36 bytes for offset annotations. first at 2 1: BOL(2) 2: EXACT <<>(4) 4: END(0) anchored `<' at 0 (checking anchored) anchored(BOL) minlen 1 Offsets: [4] 1[1] 2[1] 0[0] 3[0] first at 1 1: LOGICAL[2](2) 2: EVAL(4) 4: END(0) minlen 0 with eval Offsets: [4] 10[0] 10[0] 0[0] 11[0] Matching REx `(??{/^</})' against `<' Setting an EVAL scope, savestack=15 0 <> <<> | 1: LOGICAL[2] 0 <> <<> | 2: EVAL re_eval 0x8153fe8 Guessing start of match, REx `^<' against `<'... Guessed: match at offset 0 Matching REx `^<' against `<' Setting an EVAL scope, savestack=15 0 <> <<> | 1: BOL 0 <> <<> | 2: EXACT <<> 1 <<> <> | 4: END Match successful! Compiling REx `1' size 3 Got 28 bytes for offset annotations. first at 1 1: EXACT <1>(3) 3: END(0) anchored `1' at 0 (checking anchored isall) minlen 1 Offsets: [3] 1[1] 0[0] 2[0] Entering embedded `1' Setting an EVAL scope, savestack=21 0 <> <<> | 1: EXACT <1> failed... Freeing REx: `"1"' failed... Setting an EVAL scope, savestack=24 1 <<> <> |50339: LOGICAL[2] 1 <<> <> |50340: EVAL
Is this fixed in later perls?