How to retuen a value while using File::Find
Posted on 2005-04-26
I have two subroutines
## get the $directory after some code lines.
find (\&xlength , $directory);
my $file = $File::Find::name;
open(FILE, "<$file") || die "Can't open $file $!\n";
my @lines = <FILE>;
## do some operation on each of the files in $directory.
push (@errorMessage, "error messages");
return @errorMessage; ##==> I want this return value.
How can I return a value while using find?
I have tried
find (\&xlength(\@errorMessage), $directory);
and updating the reference in xlength.
But File::Find doesn't work then.