All:
--> What is the "suggested" way to share variables across callback
functions. My question relates to getting traversed values out of the
File::Find routine.
Below is my code. It works, although I went through many incarnations
to get it to work properly. Originally, I tried using "my $dirs"; but
the "sub wanted" would not update $dirs. The only way I could get
information out of the "sub wanted" was to create this global variable.
--> Is there a better way to share the array $dirs between my may
program and my callback function &wanted?
--> Are their potential problems with the solution below?
<body>
<h1>List of files</h1>
<%
use vars qw($dirs);
sub wanted{
push @{$dirs},$File::Find::name;
}
$dirs = [];
File::Find::find( \&wanted,"./outline" );
print @{$dirs} . " files found.";
foreach my $file (sort @$dirs){
print "$file" . "<br>";
}
%>
</body>
Thanks,
JL
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]