What you want is a Perl module called Data::Dumper.  It is completely brilliant.  It should come packaged with your Perl.  Otherwise, install it from CPAN.<br><br>"use Data::Dumper qw ( Dumper );" should go at the top of your program.  And then,<br>
<br>print Dumper(\@A);<br><br>This would show you marvellous things about your data structure.  It's essential for debugging and otherwise understanding what your complex data structures look like.<br><br>Cheers,<br> - Richard<br>
<br><div class="gmail_quote">On Sat, Jun 21, 2008 at 3:27 PM, Paul King <<a href="mailto:sciguy@vex.net">sciguy@vex.net</a>> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Thanks for referring me to perlref. I recall that it is possible to<br>
actually reverse-engineer the data structure of the module being called.<br>
Is it in perlref, or is it somewhere else?<br>
<br>
Paul King<br>
<div><div></div><div class="Wj3C7c"><br>
On Sat, 2008-06-21 at 15:05 -0400, Seneca Cunningham wrote:<br>
> 2008/6/21 Paul King <<a href="mailto:sciguy@vex.net">sciguy@vex.net</a>>:<br>
> > my @A = myobj::files::list(params);<br>
> > foreach $x (@A) {<br>
> >    for ($i = 0; $i < 16; $i++) {<br>
> >         for $j = 0; $j < 16; $j++) {<br>
> >              print "$x->[$i][$j]\n";<br>
> >         }<br>
> >    }<br>
> > }<br>
> ><br>
> > This kind of works. I get the output I expect, except for one thing. I<br>
> > don't know the array size, so I am hard-coding the upper limit of the<br>
> > loops. $#x to find the size doesn't work, since (1) $x merely points to<br>
> > an array, and (2) the array is two dimensional. Any suggestions?<br>
><br>
> If you care about the indices, you could use the form:<br>
><br>
>   foreach my $x (@A) {<br>
>      foreach my $i (0 .. (@$x -1)) {<br>
>           foreach my $j (0 .. (@{$x->[$i]} - 1)) {<br>
>                print "$x->[$i][$j]\n";<br>
>           }<br>
>      }<br>
>   }<br>
><br>
> If you don't care about the indices, you could use the form:<br>
><br>
>   foreach my $x (@A) {<br>
>      foreach my $i (@$x) {<br>
>           foreach my $j (@$i) {<br>
>                print "$j\n";<br>
>           }<br>
>      }<br>
>   }<br>
><br>
> Both forms rely upon dereferencing the arrayrefs.  The perldoc page<br>
> "perlref" has more details about referencing and dereferencing values.<br>
><br>
> --<br>
> Seneca Cunningham<br>
> <<a href="mailto:tentra@gmail.com">tentra@gmail.com</a>><br>
</div></div>> N 'T .Ǟ) m൩n2 - h',60+j^ޖ<%i -CRP DDi-j[?)"Ƣ)+-<br>
<div><div></div><div class="Wj3C7c"><br>
--<br>
The Toronto Linux Users Group.      Meetings: <a href="http://gtalug.org/" target="_blank">http://gtalug.org/</a><br>
TLUG requests: Linux topics, No HTML, wrap text below 80 columns<br>
How to UNSUBSCRIBE: <a href="http://gtalug.org/wiki/Mailing_lists" target="_blank">http://gtalug.org/wiki/Mailing_lists</a><br>
</div></div></blockquote></div><br>