Many here are reluctant to follow off-site links. Worse, such off-site postings are apt to be ephemeral... and don't make it into the Monastery db for future reference. Please see Markup in the Monastery, Perl Monks Approved HTML tags and What shortcuts can I use for linking to other information?.

Having overcome my own reluctance, here's the pastebin content as you have it formatted:

bash-3.1$ weather --weather Newcastle | ./regex.pl panic: top_env ====================================================================== +======= The output from (weather --weather Newcastle) the regex would be proce +ssing: ====================================================================== +======= bash-3.1$ weather --weather Newcastle Newcastle Light Rain Late Light Rain Late. Morning Clouds. Warm. ====================================================================== +======= ( regex.pl ) ====================================================================== +======= #!/usr/bin/perl -w use strict; my $regex = qr/\s* \w+/; while(<>) { use re 'eval'; /(?(?{$_ =~ |$regex (\w+ \w+)(?=\1)|})(?{s|$1||})|(?{s|$1 \w+| +|}))/; } ====================================================================== +========= Conclusion ====================================================================== +========= From what i can gather from lurking google, code sub-patterns are very + experimental and bug prone, ofcourse i could be wrong, seeing as i've only recently + adopted Perl in the last month once finishing my final year at school. From lurking google once more, i'm also gathering that the error messa +ge i'm receiving is a bug within perl itself, and should be reported. Bibliography: http://www.perlmonks.org/index.pl/?node_id=368099 http://prlmnks.org/html/383052.html

It would be better, of course, to enclose (only) the code (by sections) in <c>...</c> tags and the narrative in <p>...</p> tags.

Update: re desemondo's exploration,changing the use re... to use re qw(eval debug); and then testing via checking ( perl -c 813676.pl ) produced this for me (w2k, perl 5.8.8):

Compiling REx `(?(?{$data =~ |$regex (\w+ \w+)(?=\1)|})(?{s|$1||})|(?{ +s|$1 \w+||}))' size 15 Got 124 bytes for offset annotations. panic: top_env

In reply to Re: Code Sub-Pattern Error "Panic: top_env" by ww
in thread Code Sub-Pattern Error "Panic: top_env" by urthwrm

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.