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

Hello, fellow monks,

when I was offering a script to the Gods of Perl recently, they turned me down and spoke "panic: top_env".

Seeking enlightenment, I consulted with The Camel to find out what the Gods had meant, and it told me the following: "The compiler attempted to do a goto, or something weird like that." Being just a humble acolyte, I did not understand, but The Camel would speak no more.

I turned back to my script and took a look, and surely enough it was flawed; there was a typo in there that had taken a (?<=) positive look-behind assertion and turned into (?<), a meaningless abomination. In the spirit of INTERCAL, I corrected and resubmitted, and the Gods were happy; but still, I cannot figure out what wisdom lies within their words and those of The Camel, so I turn to you, fellow monks, seeking enlightenment.

--
mowgli

edited: Tue Jan 21 15:32:04 2003 by jeffa - title change (was: "something weird")

  • Comment on Unexpected 'panic: top_env' in regex match

Replies are listed 'Best First'.
Re: Unexpected 'panic: top_env' in regex match
by broquaint (Abbot) on Jan 21, 2003 at 14:52 UTC
    there was a typo in there that had taken a (?<=) positive look-behind assertion and turned into (?<), a meaningless abomination.
    If we could see the regex (and perhaps the data that was being matched) it would go a very long way to helping us solve this conundrum1.
    HTH

    _________
    broquaint

    1 although I think it's something to do with re-entrancy (or some such) in the regex engine as I've come across similar problems before and it's likely to be fixed in 5.8.0 and beyond

      Thank you - I'm still using 5.6.1, so this may indeed have caused the error. The regex thas was triggering this itself was m/(?(?{!$i})(?{s{[\w\s]*(?<=u\ )\w+.*}{just };print)|(?{print}))/, part of my (as of yet unfinished) attempts to write my first obfuscated bit of perl.

      --
      mowgli

        The expression engine is not re-entrant. You attempted to do a substitution during an eval during a conditional in a match. Also, it looks like you forgot the include the closing curly brace for your eval block right after the {just };print). I've had similar success with re-entrant regexes. Some work, some fail miserably. It's just sheer luck (or astounding insight) that keeps two simultaneously executing regexes from killing each other.


        Seeking Green geeks in Minnesota