in reply to Display $var content

Use a templating module. There are plenty, from Text::Template to Template Toolkit to HTML::Template.

perlfaq4 has a question entitled How can I expand variables in text strings? that gives a very bare bones solution that only handles simple cases. It's worth investing the time to learn about the templating modules, though, before you're tempted to write your own system. It's complicated.