use warnings; #use strict; $colnames = [ 'MEASURE', 'CNT' ]; $arrref = [ [ '# PLTADM Queries (ex batch) ', '0' ] ]; my @colnames = @{ $colnames }; print "A size:" . @colnames . "\n"; for ($i=0; $i < @colnames; $i++) { print "A: " . $i . " : " . $colnames[$i] ."\n"; } for ($i=0; $i<= @arrref; $i++) { print "B size:" . @{$arrref->[$i]} . "\n"; for ($j=0; $j< @{$arrref->[$i]}; $j++) { print "B: " . $i . " : " . $j . " : " . $arrref->[$i]->[$j] . +"\n"; } } __END__ A size:2 A: 0 : MEASURE A: 1 : CNT B size:2 B: 0 : 0 : # PLTADM Queries (ex batch) B: 0 : 1 : 0
Tip #1 from the Basic debugging checklist: strict. See also:
In reply to Re: Looping through an Array
by toolic
in thread Looping through an Array
by jarrodb
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |