The HTML Visual Quickstart Guide is perhaps one of the better HTML books, however, it still doesn't get it quite right. As mentioned before, the specs are the definitive place to learn. http://www.w3.org
This combined with the CSS spec gives you DHTML.
And if you wish to learn Perl see http://www.perldoc.com/