Your template file does not look anything like the example in Template::Manual::Intro. I recommend that you implement that example. Make and test many small changes to make it meet your requirements. Good Luck, Bill