http://www.perlmonks.org?node_id=1006093


in reply to need help to print some lines

Are you looking for something like this? You can always write a function to determine where the boundaries of the for statements should be.
$A[0][0]="a"; $A[1][0]="b"; $A[2][0]="c"; $A[3][0]="d"; $A[4][0]="e"; $A[0][1]="f"; $A[1][1]="g"; $A[2][1]="h"; $A[3][1]="i"; $A[4][1]="j"; for($col=0; $col<=1; $col++){ for($row=0; $row<=4; $row++){ print "$A[$row][$col]."; } }