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
In reply to Re: Special formatting of error messages
by davido
in thread Special formatting of error messages
by Ronnie
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |