Printing An Array



Currently I have my script print in a long list .csv file. I need to print my long list into rows of 20 elements. How can I go about doing this?

while ($x = <DATA>)
{

chop $x;
@arr = split /\s+/,$x;
$temp = @arr;
print "$arr[$temp -1],\n";

}

__DATA__
hostname01
Unknown
DL360 G3
M0PCLGP82F





Redhat_ES_3.0




Production


2.4.21-27.ELsmp
hostname03
Unknown
Netra X1











Production


117350-02
.