develooper Front page | perl.perl5.porters | Postings from March 2000

[PATCH 5.5.670] AutoSplit cleanup

From:
Greg Bacon
Date:
March 1, 2000 08:12
Subject:
[PATCH 5.5.670] AutoSplit cleanup
Message ID:
200003011620.KAA22236@ruby.itsc.uah.edu
--- perl-5.5.670.dist/lib/AutoSplit.pm	Wed Jan 26 15:40:10 2000
+++ perl-5.5.670/lib/AutoSplit.pm	Wed Mar  1 10:16:33 2000
@@ -175,10 +175,10 @@
     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 @@
     # 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 @@
     }
 
     # 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 @@
 	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};



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About