make eq unicode-aware (from Gisle Aas); fix bogus tests revealed
[p5sagit/p5-mst-13.2.git] / lib / AutoSplit.pm
index 936edc4..0be3ae6 100644 (file)
@@ -10,7 +10,7 @@ use strict;
 our($VERSION, @ISA, @EXPORT, @EXPORT_OK, $Verbose, $Keep, $Maxlen,
     $CheckForAutoloader, $CheckModTime);
 
-$VERSION = "1.0304";
+$VERSION = "1.0305";
 @ISA = qw(Exporter);
 @EXPORT = qw(&autosplit &autosplit_lib_modules);
 @EXPORT_OK = qw($Verbose $Keep $Maxlen $CheckForAutoloader $CheckModTime);
@@ -148,8 +148,8 @@ my $Is_VMS = ($^O eq 'VMS');
 
 # allow checking for valid ': attrlist' attachments
 my $nested;
-$nested = qr{ \( (?: (?> [^()]+ ) | (?p{ $nested }) )* \) }x;
-my $one_attr = qr{ (?> (?! \d) \w+ (?:$nested)? ) [\s,]* }x;
+$nested = qr{ \( (?: (?> [^()]+ ) | (??{ $nested }) )* \) }x;
+my $one_attr = qr{ (?> (?! \d) \w+ (?:$nested)? ) (?:\s*\:\s*|\s+(?!\:)) }x;
 my $attr_list = qr{ \s* : \s* (?: $one_attr )* }x;
 
 
@@ -175,10 +175,10 @@ sub autosplit_lib_modules{
     while(defined($_ = shift @modules)){
        s#::#/#g;       # incase specified as ABC::XYZ
        s|\\|/|g;               # bug in ksh OS/2
-       s#^lib/##; # incase specified as lib/*.pm
+       s#^lib/##s; # incase specified as lib/*.pm
        if ($Is_VMS && /[:>\]]/) { # may need to convert VMS-style filespecs
-           my ($dir,$name) = (/(.*])(.*)/);
-           $dir =~ s/.*lib[\.\]]//;
+           my ($dir,$name) = (/(.*])(.*)/s);
+           $dir =~ s/.*lib[\.\]]//s;
            $dir =~ s#[\.\]]#/#g;
            $_ = $dir . $name;
        }
@@ -201,7 +201,7 @@ sub autosplit_file {
     # where to write output files
     $autodir ||= "lib/auto";
     if ($Is_VMS) {
-       ($autodir = VMS::Filespec::unixpath($autodir)) =~ s|/$||;
+       ($autodir = VMS::Filespec::unixpath($autodir)) =~ s|/\z||;
        $filename = VMS::Filespec::unixify($filename); # may have dirs
     }
     unless (-d $autodir){
@@ -215,7 +215,7 @@ sub autosplit_file {
     }
 
     # allow just a package name to be used
-    $filename .= ".pm" unless ($filename =~ m/\.pm$/);
+    $filename .= ".pm" unless ($filename =~ m/\.pm\z/);
 
     open(IN, "<$filename") or die "AutoSplit: Can't open $filename: $!\n";
     my($pm_mod_time) = (stat($filename))[9];
@@ -378,7 +378,7 @@ EOT
        for my $dir (keys %outdirs) {
            opendir(OUTDIR,$dir);
            foreach (sort readdir(OUTDIR)){
-               next unless /\.al$/;
+               next unless /\.al\z/;
                my($file) = "$dir/$_";
                $file = lc $file if $Is83 or $Is_VMS;
                next if $outfiles{$file};
@@ -468,5 +468,5 @@ package Yet::Another::AutoSplit;
 sub testtesttesttest4_1 ($)  { "another test 4\n"; }
 sub testtesttesttest4_2 ($$) { "another duplicate test 4\n"; }
 package Yet::More::Attributes;
-sub test_a1 ($) : locked { 1; }
+sub test_a1 ($) : locked :locked { 1; }
 sub test_a2 : locked { 1; }