in reply to Opening a file called by a hash value

The error is the missing ; at the end of the print statement - an error that's bitten me far too often, but I still like to use here-documents, and I still can't get them right.

print <<HTML; ... some html HTML

Later on, you don't seem to be checking the result of your open call. You might want to put either an

open(LOG,"< $log") or die "Can't open $log : $!";
or, if that's revealing too much information, handle the failure with an entry in your httpd logfiles and return some other message to the user.