xaver biton wrote:
> Hi,
>
> how do I insert the values of variables of a function in a array which
> ist out of the scope of the function, e.g
>
> I've a find function and I want insert the values results of the find
> function in an array:
>
> ----------------------------------------
> my @array;
>
> sub wanted {
>     if(-f and /^aoWebCGI\.htm\z/s) {
>      my $file = $_;
>      open(FILE, "<$file");
> my $data = <FILE>;
>
> my $te = new HTML::TableExtract( depth => 0);
> $te->parse($data);
>
> foreach my $ts ($te->table_states) {
>       foreach my $row ($ts->rows){
>     if ($row->[0] =~ /Anforderungen/){
>    my $anforderungen = $row->[1];
>           push(@count, $row->[1]);
>   ... process the data and insert this in @array
> ----------------------------------------
>
>
> using "print Dumper([EMAIL PROTECTED]);
> I've no results, the @array is empty.
> If I place @array inside the sub routine then @array is full why and
> how can solve this problem?

You need to post a short, complete example that illustrates the problem. I
can't tell from your abbreviated code what's going on. An array declared
with "my" outside of any sub is in scope from the point of declaration to
the end of the file.

Do you have "use strict" in force?


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to