CGI::WML available from CPAN ... you should be able to port your code quite easily with it.
also - you need to set up the mime-type for wml in apache, 1.3.22 and up seem to have it already (don't know about previous versions).
hope that helps-
grant
Data Junction Corporation
2201 Northland Dr.
Austin, TX 78756-1117