in reply to Re^2: Creating HTML page
in thread Creating HTML page

open HTML, '>', $outname || die "Couldn't create '$outname': $!";

This is not what I suggested. I suggested what I suggested for a reason.

Also, consider using <code>...</code> around your code, so that it renders and downloads nicely.