I would strongly suggest that you consider using something like Template::Toolkit even though you might not be producing "a web page." These are very useful in creating a separation of concerns between what you want to include and exactly how you want the finished text to look.