diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 2004-08-09 18:10:42 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 2004-08-09 18:10:42 +0000 |
commit | b30707e4885ca231ff72a496671faa7830e8002a (patch) | |
tree | ceefb7d8635e495c31ba663e183cdcad8a9b157c /gnu/usr.bin/perl/lib/File | |
parent | 3c5182ca6f3c3cb0d292743e65788c0b1d03b596 (diff) |
merge 5.8.5 into HEAD
remove now-unused files
crank libperl shared library major number
update Makefile.bsd-wrapper
tweak openbsd hints file for arm and m68k
Diffstat (limited to 'gnu/usr.bin/perl/lib/File')
-rw-r--r-- | gnu/usr.bin/perl/lib/File/Basename.pm | 7 | ||||
-rw-r--r-- | gnu/usr.bin/perl/lib/File/Copy.pm | 7 | ||||
-rw-r--r-- | gnu/usr.bin/perl/lib/File/Find.pm | 31 |
3 files changed, 28 insertions, 17 deletions
diff --git a/gnu/usr.bin/perl/lib/File/Basename.pm b/gnu/usr.bin/perl/lib/File/Basename.pm index 58a740e56a1..887c7bae4a9 100644 --- a/gnu/usr.bin/perl/lib/File/Basename.pm +++ b/gnu/usr.bin/perl/lib/File/Basename.pm @@ -12,7 +12,8 @@ dirname - extract just the directory from a path use File::Basename; - ($name,$path,$suffix) = fileparse($fullname,@suffixlist) + ($name,$path,$suffix) = fileparse($fullname,@suffixlist); + $name = fileparse($fullname,@suffixlist); fileparse_set_fstype($os_string); $basename = basename($fullname,@suffixlist); $dirname = dirname($fullname); @@ -70,6 +71,8 @@ You are guaranteed that if you concatenate B<path>, B<name>, and B<suffix> together in that order, the result will denote the same file as the input file specification. +In scalar context, fileparse() returns only the B<name> part of the filename. + =back =head1 EXAMPLES @@ -142,7 +145,7 @@ our(@ISA, @EXPORT, $VERSION, $Fileparse_fstype, $Fileparse_igncase); require Exporter; @ISA = qw(Exporter); @EXPORT = qw(fileparse fileparse_set_fstype basename dirname); -$VERSION = "2.72"; +$VERSION = "2.73"; # fileparse_set_fstype() - specify OS-based rules used in future diff --git a/gnu/usr.bin/perl/lib/File/Copy.pm b/gnu/usr.bin/perl/lib/File/Copy.pm index f5b22e288a0..a43a6c6c8a8 100644 --- a/gnu/usr.bin/perl/lib/File/Copy.pm +++ b/gnu/usr.bin/perl/lib/File/Copy.pm @@ -24,7 +24,7 @@ sub mv; # package has not yet been updated to work with Perl 5.004, and so it # would be a Bad Thing for the CPAN module to grab it and replace this # module. Therefore, we set this module's version higher than 2.0. -$VERSION = '2.07'; +$VERSION = '2.08'; require Exporter; @ISA = qw(Exporter); @@ -274,11 +274,10 @@ File::Copy - Copy files or filehandles copy("Copy.pm",\*STDOUT); move("/dev1/fileA","/dev2/fileB"); - use POSIX; - use File::Copy cp; + use File::Copy "cp"; $n = FileHandle->new("/a/file","r"); - cp($n,"x");' + cp($n,"x"); =head1 DESCRIPTION diff --git a/gnu/usr.bin/perl/lib/File/Find.pm b/gnu/usr.bin/perl/lib/File/Find.pm index f9fb16b12c2..49fa48af9fc 100644 --- a/gnu/usr.bin/perl/lib/File/Find.pm +++ b/gnu/usr.bin/perl/lib/File/Find.pm @@ -3,7 +3,7 @@ use 5.006; use strict; use warnings; use warnings::register; -our $VERSION = '1.06'; +our $VERSION = '1.07'; require Exporter; require Cwd; @@ -44,21 +44,23 @@ but have subtle differences. find(\&wanted, @directories); find(\%options, @directories); -C<find()> does a breadth-first search over the given C<@directories> in the -order they are given. In essence, it works from the top down. - -For each file or directory found, the C<&wanted> subroutine is called, -with the return code ignored. (See below for details on how to use -the C<&wanted> function). Additionally, for each directory found, -it will go into that directory and continue the search. +C<find()> does a depth-first search over the given C<@directories> in +the order they are given. For each file or directory found, it calls +the C<&wanted> subroutine. (See below for details on how to use the +C<&wanted> function). Additionally, for each directory found, it will +C<chdir()> into that directory and continue the search, invoking the +C<&wanted> function on each file or subdirectory in the directory. =item B<finddepth> finddepth(\&wanted, @directories); finddepth(\%options, @directories); -C<finddepth()> works just like C<find()> except it does a depth-first search. -It works from the bottom of the directory tree up. +C<finddepth()> works just like C<find()> except that is invokes the +C<&wanted> function for a directory I<after> invoking it for the +directory's contents. It does a postorder traversal instead of a +preorder traversal, working from the bottom of the directory tree up +where C<find()> works from the top of the tree down. =back @@ -388,6 +390,12 @@ volume actually maintains its own "Desktop Folder" directory. =back +=head1 BUGS AND CAVEATS + +Despite the name of the C<finddepth()> function, both C<find()> and +C<finddepth()> perform a depth-first search of the directory +hierarchy. + =head1 HISTORY File::Find used to produce incorrect results if called recursively. @@ -583,7 +591,8 @@ sub _find_opt { local ($wanted_callback, $avoid_nlink, $bydepth, $no_chdir, $follow, $follow_skip, $full_check, $untaint, $untaint_skip, $untaint_pat, $pre_process, $post_process, $dangling_symlinks); - local($dir, $name, $fullname, $prune, $_); + local($dir, $name, $fullname, $prune); + local *_ = \my $a; my $cwd = $wanted->{bydepth} ? Cwd::fastcwd() : Cwd::getcwd(); my $cwd_untainted = $cwd; |