in reply to qr bug in perl 5.6.1 with lexicals

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!