Re: qr bug in perl 5.6.1 with lexicals
by chromatic (Archbishop) on Dec 15, 2008 at 21:27 UTC
|
I'm not sure anyone can give you a better answer without seeing some code. Is it possible to produce a small, encapsulated example?
| [reply] |
Re: qr bug in perl 5.6.1 with lexicals
by grinder (Bishop) on Dec 15, 2008 at 22:35 UTC
|
5.6.1 is completely unsupported. It is dead. It is so entirely dead that if a security flaw allowing privilege escalation was uncovered, the most likely reponse from the Perl 5 Porters would be to recommend you upgrade. No one's really familiar with that codebase any more.
So I doubt anyone will bother fixing the regexp/closure issue — subsytems that have been heavily rewritten in the intervening years since the 5.6 line was released.
• another intruder with the mooring in the heart of the Perl
| [reply] |
|
|
5.6.1 is completely unsupported. It is dead. It is so entirely dead that if a security flaw allowing privilege escalation was uncovered, the most likely reponse from the Perl 5 Porters would be to recommend you upgrade.
It's unsupported in the sense that there is a 5.6.2. There was a posting on #p5p today that someone is planning to make a 5.6.3 release. So, I wouldn't say that the 5.6.x branch is entirely unsupported. But yes, 5.6.1 is as unsupported as 5.8.8 is. And for the same reason.
| [reply] |
|
|
I imagine you are referring to ysth's remark "I'm working on a 5.6.3 just as soon
as I learn enough git." in this p5p thread?
I don't know what Yitzchak plans to do (it's not documented anywhere) but I'd be surprised if it goes much beyond getting 5.6.2 to the state where it can be compiled with current compilers.
One person does not a supported release make.
Other than that, I think we are in furious agreement :)
• another intruder with the mooring in the heart of the Perl
| [reply] |
Re: qr bug in perl 5.6.1 with lexicals
by Anonymous Monk on Dec 15, 2008 at 20:09 UTC
|
The first step is to re-produce the problem reliably, in a small self-contained example, also known as a bug report.
Barring that, UPGRADE!!! | [reply] |
|
|
I don't see how a bug report will help. The OP admitted it's already been fixed in later version.
But providing us with code that reproduces the problem could indeed be useful. Maybe we could come up with a workaround.
| [reply] |
|
|
I don't see how a bug report will help. The OP admitted it's already been fixed in later version.
Either he wants help (bug report), or not.
| [reply] |
|
|
|
|
|
Re: qr bug in perl 5.6.1 with lexicals
by ikegami (Patriarch) on Dec 15, 2008 at 21:44 UTC
|
This is probably not what you're talking about, but I know that regexps Perl blocks ((?{ }) and (??{ })) will capture lexicals. I use package variables for those.
sub lexvar {
my $var = shift;
/(?{ print($var, "\n") })/;
}
sub pkgvar {
local our $var = shift;
/(?{ print($var, "\n") })/;
}
lexvar('abc'); # abc
lexvar('def'); # abc
pkgvar('abc'); # abc
pkgvar('def'); # def
It's not limited to 5.6, though. 5.6, 5.8 and 5.10 all give the same output.
Don't make us guess, show us some code!
| [reply] [d/l] [select] |
Re: qr bug in perl 5.6.1 with lexicals
by Anonymous Monk on Dec 15, 2008 at 20:21 UTC
|
Answer 1: only use a recent version of perl.
Answer 2: only parse files with the same format.
duh! | [reply] |
Re: qr bug in perl 5.6.1 with lexicals
by Anonymous Monk on Dec 16, 2008 at 23:30 UTC
|
I bumped into a bug in perl 5.6.1
It seems that qr// can compile regexps to true lexical variables only in perls above 5.6.1. Otherwise, they get compiled to globals (or package-scoped variables) even if they involve my-scoping. (Maybe the regexp gets compiled to a global and the local variable is just a pointer to the global.)
Info here
It seems that "my" for regexps is also broken.
I think this is the issue.
| [reply] |
|
|
The problem is that split() chokes when you supply a regexp with //o or compilier with qr.
| [reply] |
|
|
>c:\progs\perl561\bin\perl -le"$x=qr/,/; print for split $x, 'a,b,c'"
a
b
c
Still not enough information. Don't make us guess, show us some code! | [reply] [d/l] |
|
|
|
|