Change 20690 by [EMAIL PROTECTED] on 2003/08/14 05:18:30
Integrate:
[ 20578]
Fix from Dave Mitchell to the recent from lib/Devel/SelfStubber.t:
Variable "$nested" is not available at (re_eval 4) line 2, <DATA> line 8.
which was on old bug unearthed by the change #20559.
Basically, qr// + (??{$lexical}) combination is very, VERY broken.
Workaround is not to use lexicals.
[ 20583]
Change #20578 to SelfLoader is probably also useful to AutoSplit.
(Strictly speaking these would no be necessary (yet) for maint
since the more recent lexical patches have not yet been merged,
but since the qr// + (??{$lexical}) combination is dubious in
any case, let's.)
Affected files ...
... //depot/maint-5.8/perl/lib/AutoSplit.pm#3 integrate
... //depot/maint-5.8/perl/lib/SelfLoader.pm#2 integrate
Differences ...
==== //depot/maint-5.8/perl/lib/AutoSplit.pm#3 (text) ====
Index: perl/lib/AutoSplit.pm
--- perl/lib/AutoSplit.pm#2~18379~ Tue Dec 31 07:33:11 2002
+++ perl/lib/AutoSplit.pm Wed Aug 13 22:18:30 2003
@@ -148,10 +148,12 @@
my $Is_VMS = ($^O eq 'VMS');
# allow checking for valid ': attrlist' attachments
-my $nested;
+# (we use 'our' rather than 'my' here, due to the rather complex and buggy
+# behaviour of lexicals with qr// and (??{$lex}) )
+our $nested;
$nested = qr{ \( (?: (?> [^()]+ ) | (??{ $nested }) )* \) }x;
-my $one_attr = qr{ (?> (?! \d) \w+ (?:$nested)? ) (?:\s*\:\s*|\s+(?!\:)) }x;
-my $attr_list = qr{ \s* : \s* (?: $one_attr )* }x;
+our $one_attr = qr{ (?> (?! \d) \w+ (?:$nested)? ) (?:\s*\:\s*|\s+(?!\:)) }x;
+our $attr_list = qr{ \s* : \s* (?: $one_attr )* }x;
==== //depot/maint-5.8/perl/lib/SelfLoader.pm#2 (text) ====
Index: perl/lib/SelfLoader.pm
--- perl/lib/SelfLoader.pm#1~17645~ Fri Jul 19 12:29:57 2002
+++ perl/lib/SelfLoader.pm Wed Aug 13 22:18:30 2003
@@ -10,10 +10,12 @@
my %Cache; # private cache for all SelfLoader's client packages
# allow checking for valid ': attrlist' attachments
-my $nested;
+# (we use 'our' rather than 'my' here, due to the rather complex and buggy
+# behaviour of lexicals with qr// and (??{$lex}) )
+our $nested;
$nested = qr{ \( (?: (?> [^()]+ ) | (??{ $nested }) )* \) }x;
-my $one_attr = qr{ (?> (?! \d) \w+ (?:$nested)? ) (?:\s*\:\s*|\s+(?!\:)) }x;
-my $attr_list = qr{ \s* : \s* (?: $one_attr )* }x;
+our $one_attr = qr{ (?> (?! \d) \w+ (?:$nested)? ) (?:\s*\:\s*|\s+(?!\:)) }x;
+our $attr_list = qr{ \s* : \s* (?: $one_attr )* }x;
sub croak { require Carp; goto &Carp::croak }
End of Patch.