Unwired Planet's Developer Program (http://updev.phone.com/) offers a great HDML and WAP (Though I don't like WAP) emulator. Very functional and can emulate a large variety of phones;
As for HDML in Perl, its quite easy - I've made an HDML system for my web site (otoh.cjb.net) and even have written a little HDML tutorial (otoh.cjb.net/flog.cgi?co1.
--Xunker