http://www.perlmonks.org?node_id=369711


in reply to File::Find blind

You put the $source_dir variable inside the hashref which is the first argument. $source_dir should be the second argument to find:
find({ no_chdir => 1, wanted => sub { print STDERR "*** Doing $_ ***\n"; if (-f) { print "...Adding $_\n" } elsif (-d _) { print "Adding dir $_...\n" } } }, $source_dir) or die "$0: $!\n";
Arjen