X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FSelfLoader.pm;h=40c92db6b7a3b41c15bc17f6dff61aa5d2162d4c;hb=5438961c527f841385f3ab1b8503235cb786f085;hp=59defe0bb27ed2e8e1edae10e313480061fbcd35;hpb=88d01e8dd0be693cf54a3bafc9974fa70eda2ddd;p=p5sagit%2Fp5-mst-13.2.git diff --git a/lib/SelfLoader.pm b/lib/SelfLoader.pm index 59defe0..40c92db 100644 --- a/lib/SelfLoader.pm +++ b/lib/SelfLoader.pm @@ -3,17 +3,19 @@ package SelfLoader; require Exporter; @ISA = qw(Exporter); @EXPORT = qw(AUTOLOAD); -$VERSION = "1.0903"; +$VERSION = "1.0904"; sub Version {$VERSION} $DEBUG = 0; 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 }