in reply to Problem with Find

You might try adding:

$File::Find::dont_use_nlink= 1;

near the top. This bug in File::Find existed for many years even after I complained about it. The most recent File::Find claims that it never causes a problem, but all of the previous versions also claimed that when it clearly wasn't true. (:

Your problem description doesn't match what I'd expect if this were the problem, however. Your problem description sounds like a bug in File::Find (like it is not properly clearing out some remembered state from the first run). But that is just a guess as well.

If I had this problem and cared about getting File::Find fixed, then I'd use "perl -d" to see why the second run is stopping early.

Even more likely, I'd just replace File::Find with about a dozen lines of fairly simple code, for example, Re^2: aborting File::Find::find (gotchas). :)

- tye        

Replies are listed 'Best First'.
Re^2: Problem with Find (classic)
by redhotchippyleper (Novice) on Nov 20, 2006 at 16:38 UTC
    Thanks for the advice folks, i will make the small changes you suggested. As for the main problem, it is indeed Find::File in 5.6.1 that is causing my issue. I replaced find.pm with another version and it worked ok, still like you say i am wary of File::Find now. The @ARGV thing stopped being a problem as long as i used 'perl' when executing. i.e. "perl.exe pstfind.pl arg.txt". If i just wrote "pstfind.pl arg.txt" it failed. Wonder if its because with 5.6.1 install directtory it does not like a space in the path to the bin folder. "#!c:\program files\perl\bin -w". I will have a longer look at the code you provided and see about using it instead. Thanks.