in reply to Create a html page on fly

In addition to what everybody's already said...

print HTML "Content-Type: text/html\n\n";

The above prints an HTTP header which has no business being in an HTML file on the filesystem. Ditch it.

perl -E'sub Monkey::do{say$_,for@_,do{($monkey=[caller(0)]->[3])=~s{::}{ }and$monkey}}"Monkey say"->Monkey::do'