in reply to Perlscript ASP page responds strangely

moving our company's ASP pages from VBS to Perlscript

Ah... A classic gotchya.
if ($rtype = "header ")
should be changed to
if ($rtype eq "header ")
instead. The '=' sign in the VB 'if' means equality test, but in Perl is an assignment. And also because you are comparing are two strings, you should use the 'eq' comparison keywords.