diff options
author | Gurusamy Sarathy <gsar@cpan.org> | 2000-02-29 08:13:56 +0000 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 2000-02-29 08:13:56 +0000 |
commit | 1b1e14d34a33bfe0df591910cafcab54421ca8a8 (patch) | |
tree | 08139b987940809c84a23705445e464a57d17d1e /lib/File/Path.pm | |
parent | 0dfc8e26aed087a9a86fe8dfa45fbe33997b9602 (diff) | |
download | perl-1b1e14d34a33bfe0df591910cafcab54421ca8a8.tar.gz |
more m//s and $ vs \z fixups (from Greg Bacon)
p4raw-id: //depot/perl@5349
Diffstat (limited to 'lib/File/Path.pm')
-rw-r--r-- | lib/File/Path.pm | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/File/Path.pm b/lib/File/Path.pm index 59b72baa45..79fdfb6ca1 100644 --- a/lib/File/Path.pm +++ b/lib/File/Path.pm @@ -118,7 +118,7 @@ sub mkpath { $paths = [$paths] unless ref $paths; my(@created,$path); foreach $path (@$paths) { - $path .= '/' if $^O eq 'os2' and $path =~ /^\w:$/; # feature of CRT + $path .= '/' if $^O eq 'os2' and $path =~ /^\w:\z/s; # feature of CRT next if -d $path; # Logic wants Unix paths, so go with the flow. $path = VMS::Filespec::unixify($path) if $Is_VMS; @@ -157,7 +157,7 @@ sub rmtree { my($root); foreach $root (@{$roots}) { - $root =~ s#/$##; + $root =~ s#/\z##; (undef, undef, my $rp) = lstat $root or next; $rp &= 07777; # don't forget setuid, setgid, sticky bits if ( -d _ ) { @@ -181,8 +181,8 @@ sub rmtree { # Deleting large numbers of files from VMS Files-11 filesystems # is faster if done in reverse ASCIIbetical order @files = reverse @files if $Is_VMS; - ($root = VMS::Filespec::unixify($root)) =~ s#\.dir$## if $Is_VMS; - @files = map("$root/$_", grep $_!~/^\.{1,2}$/,@files); + ($root = VMS::Filespec::unixify($root)) =~ s#\.dir\z## if $Is_VMS; + @files = map("$root/$_", grep $_!~/^\.{1,2}\z/s,@files); $count += rmtree(\@files,$verbose,$safe); if ($safe && ($Is_VMS ? !&VMS::Filespec::candelete($root) : !-w $root)) { |