in reply to Pointers to formatting output
And the output -my @text = ( "Project status :", "DB update :", "Some column :", ); my $max_line_width = 0; # capitalize the first letter of every word, and record # the maximum width of the lines seen. my @formatted_text = map { s/(\w+)/\u\L$1/g; $max_line_width = length if $max_line_width < length; $_ } @text; # insert spaces before the colon ':' to pad the string to # the maximum line width recorded my @formatted_text = map { substr($_, -1, 0) = ' ' x ($max_line_width - length); $_ } @formatted_text; print "$_\n" for @formatted_text;
Project Status : Db Update : Some Column :
|
|---|