in reply to Problem using File::Find
Note that $File::Find::name is not the folder; it's the full file name.
Note also that you may have to set options to follow symbolic links, etc.
This entire program works for me:
#!/usr/bin/perl -w use strict; use File::Find; my @files=qw(. src); my $found; sub wanted { $found ||= $File::Find::name if $_ eq "xx.pl"; } find(\&wanted, @files); print "$found\n";
|
|---|