my @WorkingTPM = qw( enter the current list of working tpm from tpm-ctan-check here before calling this script then copy the output back to tpm-ctan-check ); my @foo = sort {uc($a) cmp uc($b)} @WorkingTPM; print_foo(@foo); sub firstletter { my ($bar) = @_; my @foo = split //, $bar; return(uc($foo[0])); } sub print_foo { my(@foo) = @_; my $newletter = 1; my $curline = ""; my $curletter = ""; my $initshift = " "; my $medshift = " "; foreach $t (@foo) { my $fl = firstletter($t); if ($fl eq $curletter) { if (length($curline) + 1 + length($t) >= 70) { print "$curline\n"; $curline = "$initshift$medshift$t"; } else { $curline .= " $t"; } } else { print "$curline\n"; $curline = "$initshift$t"; $curletter = $fl; } } print $curline; }