in reply to Why doesnt the string returned by $File::Find::name find point to files
Try removing all the cruft from your test code and report failures in a fashion that shows issues with white space in file names clearly. I notice that your code has fairly arbitary use of white space, including a space at the start of a (unused) path variable.
I also notice that the result you report can not have come from the code that you provided because the use of white space is different.
Try the following code and see if you can reproduce the error:
#!/usr/local/bin/perl -w # force taint checks, and print warnings use strict; use File::Find; my $Start_dir = shift; die ">$Start_dir< is not a directory\n" if ! -d $Start_dir; find(\&process, $Start_dir); sub process { return if -d $File::Find::name; return if -f $File::Find::name; # This is success - the file exist +s print ">$File::Find::name< is not a file or was not found\n"; <p>}
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Why doesnt the string returned by $File::Find::name find point to files
by richill (Monk) on May 06, 2006 at 10:40 UTC |