my @UACS; # open(POLICY, "getpol -t UACS |"); commented - replaced by __DATA__ for this example my $pol; while () # ($pol = ) <== could this be changed to while (my $pol = ), to remove the previous line ?? { chomp $_; # was $pol my($type,$number,$name); ($type, $number, $name) = split (/\|/, $_, -1); chomp $name; push(@UACS,$name); } @UACS = sort(@UACS); while (@UACS) { my @rows = splice(@UACS, 0, 6); printf "%-12s %-12s %-12s %-12s %-12s %-12s\n", @rows; } print "\nPress ENTER to continue..."; my $a = ; # close(POLICY); commented - superfluous due to __DATA__ for this example __DATA__ UAC|10|ADMIN|Description1| UAC|20|CIRC|Description2| UAC|30|CIRCADMIN|Description3| UAC|40|CIRCBEE|Description4| UAC|50|CIRCBRO|Description5| UAC|60|CIRCBUR|Description6| UAC|70|CIRCBUW|Description7| UAC|80|CIRCCAS|Description8| UAC|90|CIRCCOM|Description9|