in reply to using filehandle to open files listed in array
I don't think you want this combination. $File::Find::name is the path including any parent directories, but you're already chdir'ed into the directory containing the file. Inside wanted, you want to use $_. After the execution is complete, you'll want $File::Find::name.sub wanted { my $fileopened = $File::Find::name;
More specifically, when you're thinking about "a/b/c.txt", you're already in the directory "a/b", so trying to open "a/b/c.txt" is wrong now. You want just c.txt, which is in $_. Review the thread beginning in "using file::find::name and file tests". (update: oh, that was you. apparently you didn't learn anything from the other posts!)
-- Randal L. Schwartz, Perl hacker
Be sure to read my standard disclaimer if this is a reply.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: using filehandle to open files listed in array
by richill (Monk) on May 14, 2006 at 20:17 UTC | |
by jwkrahn (Abbot) on May 14, 2006 at 20:41 UTC |