Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
1. Considering the following code snippet, can someone tell me what is going on?
2. The following gives me the desired results (the file name without its location), except when the starting directory is /. Why? And what could I do to fix it?@path{@INC} = (); # Then later in the find sub, we see: $File::Find::prune = 1, return if exists $path{$File::Find::dir} and $File::Find::dir ne $File +::Find::topdir; # What is going in the above line? What is the purpose?
Thanks!$name = substr $File::Find::name, length $File::Find::topdir;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: File::Find questions
by GrandFather (Saint) on Dec 08, 2005 at 02:37 UTC | |
|
Re: File::Find questions
by vek (Prior) on Dec 08, 2005 at 07:57 UTC | |
|
Re: File::Find questions
by svenXY (Deacon) on Dec 08, 2005 at 09:51 UTC |