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
|