in reply to CGI script to create a HTML document

You're missing one pragma: warnings.

use warnings;
Then you'll notice (maybe - if you scroll back):
Odd number of elements in anonymous hash at ./x.pl line 27.
That {-style=>color=>"blue"} looks awfully suspicious. Perhaps you meant {-style => 'color: blue'} instead?