use Util::Columns; my @list = ; chomp @list; my $columns = get_columns(7, \@list); # why take another step to get an integer? # If you don't add 1 to the result of the division below, # you will get an additional column. my $splicer = (scalar(@list) / $columns) + 1; my $row; push @$row, join("\n", splice(@list, 0, $splicer)) while @list; # then print the row however you like ####