Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"

Re^2: File::Find in a loop

by 2teez (Priest)
on Apr 28, 2013 at 21:45 UTC ( #1031113=note: print w/replies, xml ) Need Help??

in reply to Re: File::Find in a loop
in thread File::Find in a loop

find( \&wanted ($dir), $dir );
No! I don't think so.

The File::Find documentation makes this clear saying thus:

wanted function takes no arguments but rather does its work through a collection of variables.
$File::Find::dir is the current directory name,
$_ is the current filename within that directory
$File::Find::name is the complete pathname to the file.
These variables have all been localized and may be changed without affecting data outside of the wanted function.

Replies are listed 'Best First'.
Re^3: File::Find in a loop
by Laurent_R (Canon) on Apr 28, 2013 at 22:27 UTC

    Yes, you are right, what I suggested does not work. It has been a long time since I last looked at the File::Find documentation, I did not remember at all about that.

    Sorry about my mistake and thank you, 2teez, for pointing out this error.

    Having said that, this is (as far as I know) the first time that one of my posts had a negative reputation (-1 as of this reading). OK, well, my mistake, someone down voted me, I should know better, fair enough. I should add that I am not particularly concerned about that (and I only partly understand the reputation thing). But I did not think that an error in a post where I said that this just *might* be a solution and in which I very specifically said that this was untested deserved a down voting. But, of course, someone out there thinks that none should talk unless she or he knows everything about every single module. Oh, well...

      But, of course, someone out there thinks that none should talk unless she or he knows everything about every single module.

      No. Just those you offer help for.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1031113]
[ambrus]: Corion: no, backwards. It's possible in the general case, but not in the specific case of bad data we have. Which is why it's harder to explain.
[marto]: that reminds me, to donate...
[ambrus]: If it was possible in this specific case, then the burden to argue for that would be his.
[Corion]: ambrus: Ah, but he's the boss, so the burden to show that it's impossible still lies on you :-)
[Corion]: ambrus: I would work with him through an example

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (8)
As of 2017-12-12 13:16 GMT
Find Nodes?
    Voting Booth?
    What programming language do you hate the most?

    Results (332 votes). Check out past polls.