BTW, if you need to see a preview, use the web preview built into TextMate (Ctrl+Option+Command+P), select "Show Options", select "Pipe text through" and enter the path to your markdown.pl script.
The web preview uses web kit (i.e. KHTML, the same rendering engine as Safari), which is, in my experience, as good or better than other browsers at rendering XHTML. THe only place it "fails" is when CSS rules try to change the appearance of form elements (mostly input buttons).
Cheers!