in reply to Re^2: no output
in thread no output

So you are using a template file to render an output file. Use HTML::Template. Despite the name it's a general purpose templating system that does well and consistently what you are trying to do.

Premature optimization is the root of all job security