in reply to Re^3: Break an array. I think.
in thread Break an array. I think.
Using this you could arbitrarily increase the number of elements, not worry about their values, and it would always give you three elements to a row. To get them to line up, unless you're assured of using single digits, you'd probably either want to use sprintf or at least separate them by tabs.my @datan = qw(1 2 3 4 5 6); for ($cnt=0; $cnt<=$#datan; $cnt++) { print "\n" if $cnt%3 == 0;## remainder==zero after division by 3 print "$datan[$cnt] "; } print "\n";
|
|---|