As KevinR loosely pointed to, HTML::Template is looking at your filename template as an absolute path (because it begins with a '/'). That is to say.. it's looking for the template off of your root path inside the `templates' directory.

e.g. /templates

If your web server serves files out of the /var/www, then you'll want to use, filename => '/var/www/templates/main.tmpl'.