Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
($languagefile) = find(\&search_localdir, $local_inst_dir);
Problem here is it is not returning when there is a match. It continues to check the remaining files also. What I want is, it should return the filename and transfer the control to main program without further find. Please help me to achieve that.sub search_localdir { chomp($FILE_TO_FIND); if ($FILE_TO_FIND eq $_){ print "SRC:$FILE_TO_FIND\nDES:$_\n"; return $File::Find::name; } return 0; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Problem - Recursive file find using File::Find
by CountZero (Bishop) on May 14, 2009 at 09:17 UTC | |
|
Re: Problem - Recursive file find using File::Find
by moritz (Cardinal) on May 14, 2009 at 09:04 UTC | |
|
Re: Problem - Recursive file find using File::Find
by duff (Parson) on May 15, 2009 at 00:20 UTC |