Re: find2perl . -xdev BROKEN still
authorRoderick Schertler <roderick@gate.net>
Thu, 19 Dec 1996 17:44:34 +0000 (12:44 -0500)
committerChip Salzenberg <chip@atlantic.net>
Thu, 19 Dec 1996 23:14:00 +0000 (11:14 +1200)
On Thu, 19 Dec 1996 08:06:04 -0800, David Dyck <dcd@TC.FLUKE.COM> said:
>
> It seems that the -xdev feature for find2perl has been broken for that
> last few subversions.
>
> I think it is because $topdev is no longer exported from find.

You are right.  This has been broken since find.pl was replaced with a
wrapper around File::Find.  Here's a fix.

PS:  I know this has come up before, but why don't we offer $name, $dir
and so on (or maybe $find_name, etc, aliases) in @EXPORT_OK?

p5p-msgid: <pzvi9yig3h.fsf@eeyore.ibcinc.com>

lib/File/Find.pm
lib/find.pl
lib/finddepth.pl

index c5ce68ca1a053a76a14da501fd2b2f4d6ffa61c3..1faea50158f36f1e1281615e81061cc85956e541 100644 (file)
@@ -74,7 +74,9 @@ that don't resolve:
 sub find {
     my $wanted = shift;
     my $cwd = Cwd::cwd();
-    my ($topdir,$topdev,$topino,$topmode,$topnlink);
+    # Localize these rather than lexicalizing them for backwards
+    # compatibility.
+    local($topdir,$topdev,$topino,$topmode,$topnlink);
     foreach $topdir (@_) {
        (($topdev,$topino,$topmode,$topnlink) = stat($topdir))
          || (warn("Can't stat $topdir: $!\n"), next);
@@ -163,7 +165,9 @@ sub finddepth {
 
     $cwd = Cwd::fastcwd();;
 
-    my($topdir, $topdev, $topino, $topmode, $topnlink);
+    # Localize these rather than lexicalizing them for backwards
+    # compatibility.
+    local($topdir, $topdev, $topino, $topmode, $topnlink);
     foreach $topdir (@_) {
        (($topdev,$topino,$topmode,$topnlink) = stat($topdir))
          || (warn("Can't stat $topdir: $!\n"), next);
index 29b83b082c85bcfe9f56fdd57fb600a9305e7160..ee5dc5d150654e9330b5aaeeeab089eb86291f79 100644 (file)
 
 use File::Find ();
 
-*name = *File::Find::name;
-*prune = *File::Find::prune;
-*dir = *File::Find::dir;
+*name          = *File::Find::name;
+*prune         = *File::Find::prune;
+*dir           = *File::Find::dir;
+*topdir                = *File::Find::topdir;
+*topdev                = *File::Find::topdev;
+*topino                = *File::Find::topino;
+*topmode       = *File::Find::topmode;
+*topnlink      = *File::Find::topnlink;
 
 sub find {
     &File::Find::find(\&wanted, @_);
index 5814a44b1fc85770c2960f5ffa04dd248a636013..bfa44bb1bc9d51d071ca04c1844bc63b1d7ae71a 100644 (file)
 
 use File::Find ();
 
-*name = *File::Find::name;
-*prune = *File::Find::prune;
-*dir = *File::Find::dir;
+*name          = *File::Find::name;
+*prune         = *File::Find::prune;
+*dir           = *File::Find::dir;
+*topdir                = *File::Find::topdir;
+*topdev                = *File::Find::topdev;
+*topino                = *File::Find::topino;
+*topmode       = *File::Find::topmode;
+*topnlink      = *File::Find::topnlink;
 
 sub finddepth {
     &File::Find::finddepth(\&wanted, @_);