I think in your case you should be fine with formats. However, if you have something more complex or would like to split up code and layout, then a templating system might be a good solution, see e.g. a discussion on Text::Template here at PM, with pointers to other templating modules.