more m//s and $ vs \z fixups (from Greg Bacon)
[p5sagit/p5-mst-13.2.git] / lib / AutoSplit.pm
index feecd58..41d5489 100644 (file)
@@ -1,17 +1,16 @@
 package AutoSplit;
 
+use 5.005_64;
 use Exporter ();
 use Config qw(%Config);
 use Carp qw(carp);
 use File::Basename ();
 use File::Path qw(mkpath);
 use strict;
-use vars qw(
-           $VERSION @ISA @EXPORT @EXPORT_OK
-           $Verbose $Keep $Maxlen $CheckForAutoloader $CheckModTime
-          );
+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);
@@ -150,7 +149,7 @@ 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;
+my $one_attr = qr{ (?> (?! \d) \w+ (?:$nested)? ) (?:\s*\:\s*|\s+(?!\:)) }x;
 my $attr_list = qr{ \s* : \s* (?: $one_attr )* }x;
 
 
@@ -353,8 +352,10 @@ EOT
        }
        $last_package = $this_package if defined $this_package;
     }
-    print OUT @cache,"1;\n# end of $last_package\::$subname\n";
-    close(OUT);
+    if ($subname) {
+       print OUT @cache,"1;\n# end of $last_package\::$subname\n";
+       close(OUT);
+    }
     close(IN);
     
     if (!$keep){  # don't keep any obsolete *.al files in the directory
@@ -467,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; }