in reply to Re: Problem with Find
in thread Problem with Find

Actually in that context ($dir) is no different than $dir. In fact you can write find (\&wanted, $dir1, $dir2, $dir3). Remember that Perl flattens lists when passed to a sub.

If that were the problem find would fail completely rather than finding the first few files in some directories. If find required an array (reference) rather than a list of directories then the syntax would be:

find (\&wanted, [$dir]);

but find complains about that with "Can't stat ARRAY(0x1e7ac3c): No such file or directory at ...".


DWIM is Perl's answer to Gödel