use strict; use warnings; my $policy = <) { chomp $pol; push @UACS, (split /\|/, $pol, -1)[2]; } my $line; while (@UACS) { $line .= sprintf '%-22s ', shift @UACS; next if length $line < 60; print "$line\n"; $line = ''; } print $line;