in reply to Multi-line output with format

Check out Text::Reform.