diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2007-03-31 11:30:09 -0400 |
---|---|---|
committer | Steve Peters <steve@fisharerojo.org> | 2007-04-01 13:10:11 +0000 |
commit | 4764e399f58c2e035a482e18aea2bd8c44fd9083 (patch) | |
tree | a3223a823f2ae68027ab629b4746132501179ad9 /lib | |
parent | 2eacba2f038fca0c7ce4713e73ef229faa3f3caa (diff) | |
download | perl-4764e399f58c2e035a482e18aea2bd8c44fd9083.tar.gz |
Symbian sync
Message-ID: <460EB6C1.4020406@iki.fi>
p4raw-id: //depot/perl@30824
Diffstat (limited to 'lib')
-rw-r--r-- | lib/AutoSplit.pm | 27 | ||||
-rw-r--r-- | lib/constant.pm | 2 |
2 files changed, 22 insertions, 7 deletions
diff --git a/lib/AutoSplit.pm b/lib/AutoSplit.pm index bf9280623f..a6c0ee32b2 100644 --- a/lib/AutoSplit.pm +++ b/lib/AutoSplit.pm @@ -1,6 +1,5 @@ package AutoSplit; -use 5.009005; # due to "my $_" and new regexp features use Exporter (); use Config qw(%Config); use File::Basename (); @@ -146,9 +145,14 @@ if (defined (&Dos::UseLFN)) { } my $Is_VMS = ($^O eq 'VMS'); -# allow checking for valid ': attrlist' attachments +# allow checking for valid ': attrlist' attachments. +# extra jugglery required to support both 5.8 and 5.9/5.10 features +# (support for 5.8 required for cross-compiling environments) -my $attr_list = qr{ +my $attr_list = + $] >= 5.009005 ? + eval <<'__QR__' + qr{ \s* : \s* (?: # one attribute @@ -158,7 +162,18 @@ my $attr_list = qr{ ) (?: \s* : \s* | \s+ (?! :) ) )* -}x; + }x +__QR__ + : + do { + # In pre-5.9.5 world we have to do dirty tricks. + # (we use 'our' rather than 'my' here, due to the rather complex and buggy + # behaviour of lexicals with qr// and (??{$lex}) ) + our $trick1; # yes, cannot our and assign at the same time. + $trick1 = qr{ \( (?: (?> [^()]+ ) | (??{ $trick1 }) )* \) }x; + our $trick2 = qr{ (?> (?! \d) \w+ (?:$trick1)? ) (?:\s*\:\s*|\s+(?!\:)) }x; + qr{ \s* : \s* (?: $trick2 )* }x; + }; sub autosplit{ my($file, $autodir, $keep, $ckal, $ckmt) = @_; @@ -181,8 +196,8 @@ sub carp{ sub autosplit_lib_modules { my(@modules) = @_; # list of Module names - - while (defined(my $_ = shift @modules)) { + local $_; # Avoid clobber. + while (defined($_ = shift @modules)) { while (m#([^:]+)::([^:].*)#) { # in case specified as ABC::XYZ $_ = catfile($1, $2); } diff --git a/lib/constant.pm b/lib/constant.pm index 83714a89a4..f1b4d73f59 100644 --- a/lib/constant.pm +++ b/lib/constant.pm @@ -109,7 +109,7 @@ sub import { # constants from cv_const_sv are read only. So we have to: Internals::SvREADONLY($scalar, 1); $symtab->{$name} = \$scalar; - Internals::inc_sub_generation; + &Internals::inc_sub_generation; } else { *$full_name = sub () { $scalar }; } |