in reply to Special formatting of error messages
Sounds like something that formats would be useful for. Hmm... that's the first time I've ever said that. I've probably been missing out on a lot of fun.
Without formats, you just have to do a two-pass approach. First, determine the length of the widest string being output. length is handy for that. Second, each string needs to be padded with ( $length_max - $length_current ) / 2 leading space characters, and with $length_max - $new_current_length space characters trailing.
Dave
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Special formatting of error messages
by Ronnie (Scribe) on Feb 02, 2005 at 09:05 UTC | |
by davido (Cardinal) on Feb 02, 2005 at 17:11 UTC |