[htmltmpl] How to Put reference array in to structure fro use in H::T?
Brought to you by:
samtregar
From: Dale W. H. <dal...@in...> - 2004-09-27 13:23:03
|
I am using the Perl DBI to access a database. In particular, I' calling = the fetchall_arrayref. How do I get the returned information into a usable structure so that I = can loop through each row, then each column in the row? The returned info is as such: Reference --> Reference to Row0 --> ( col0, col1, col2, etc...) Reference to Row1 --> ( col0, col1, col2, etc...) etc... I can acceccs it using the below loop: foreach my $array (@array) { my($i, $j); for $i ( 0 .. $#{$array} ) { my $count =3D ($i + 1); print "ROW $count\t"; for $j ( 0 .. $#{$array->[$i]} ) { $array->[$i][$j] =3D "NULL" if ($array->[$i][$j] eq ""); print "$array->[$i][$j]\t"; } print "\n"; } } How do I get the information into correct structure to use as a nested = loop in my template? Thanks in Advance! -Dale |