Open GoogleCodeExporter opened 9 years ago
Interesting. I thought only access to lexicals vs globals is still broken.
Original comment by reini.urban
on 20 Jun 2014 at 4:11
This problem is very similar to the one illustrated in issue 348, except it
pertains to the saving of CVs. To wit, in Nicolas' example, calling foo()
prior to the regex will cause his example to work. On the other hand, calling
foo() in an anonymous subroutine that is called prior to the regex will not
cause his example to work. Furthermore, this problem manifests in plain
regexes, not just quoted regexes.
I've attached a few files which illustrate my points more explicitly.
Original comment by erin.schoenhals
on 20 Jun 2014 at 6:12
Attachments:
Apologies: Within a regex, this problem only occurs when passing an argument to
a function in a function call. On the other hand, when passing an explicit
value to a function inside a regex function call, rather than a match variable
within a regex, perlcc fails in a different manner (which probably warrants a
different issue):
Number found where operator expected at (re_eval 1) line 1, near "foo 36"
(Do you need to redeclare foo?)
syntax error at (re_eval 1) line 1, near "foo 36"
Compilation failed in regexp.
Original comment by erin.schoenhals
on 20 Jun 2014 at 9:37
Erin's testcase:
sub foo { '42'; }
if ("42 cats" =~ /^(??{foo})/) {
print "ok\n";
}
#foo();
Original comment by reini.urban
on 31 Aug 2014 at 7:28
Original issue reported on code.google.com by
nicolas....@gmail.com
on 19 Jun 2014 at 7:59