3 #==================================================
5 # File ID: 54673c7e-5d37-11df-bc5d-90e6ba3022ac
7 #==================================================
13 our ($opt_w, $opt_h) =
20 Syntax: $0 [-w width] [file [files ...]]
22 Centers text from stdin or files. If no width is specified, the longest
34 die("$opt_w: Invalid line length");
42 $Longest = length($_) if (length($_) > $Longest);
46 for my $Curr (@Lines) {
48 $Curr =~ s/^\s*(.*?)\s*$/$1/;
49 my $curr_len = length($Curr);
50 if ($curr_len < $Longest) {
51 $Curr = (" " x
int(($Longest-$curr_len)/2)) . $Curr;
52 $Curr .= " " x
($Longest-length($Curr));