Of course: Perl threw you an error saying --as per use strict-- Global symbol "$i" requires explicit package name at ... and that unexpected error message played havoc with the headers of your HTML-page.
CountZero
"If you have four groups working on a compiler, you'll get a 4-pass compiler." - Conway's Law
Comment on Re^5: using pagecount variable in array?