File::Find doesn't seem to work...

Very simple one this - I am trying to do a recursive file tree search. I thought that the find function from File::Find would suit my needs. The following script, however, does nothing - it doesn't even seem to call the subroutine.

use File::Find;

find(\&search);

sub search
{
      print File::Find::name . "\n";
}
IshaniAsked:
Who is Participating?
 
clockwatcherConnect With a Mentor Commented:
Glad to have been of help. :-)
0
 
clockwatcherCommented:
use File::Find;

find(\&search, ".");

sub search {
 print $File::Find::name . "\n";
}

0
 
IshaniAuthor Commented:
doh. i thought it used current directory.

Its working now, thanks..

add this as a question and have the points...
0
All Courses

From novice to tech pro — start learning today.