Change 20578 by [EMAIL PROTECTED] on 2003/08/09 07:34:16

        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.

Affected files ...

... //depot/perl/lib/SelfLoader.pm#16 edit

Differences ...

==== //depot/perl/lib/SelfLoader.pm#16 (text) ====
Index: perl/lib/SelfLoader.pm
--- perl/lib/SelfLoader.pm#15~12040~    Sun Sep 16 13:36:58 2001
+++ perl/lib/SelfLoader.pm      Sat Aug  9 00:34:16 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.

Reply via email to