Rather than using <pre></pre>, use <CODE></CODE> tags as per the Site How To. This will correctly escape brackets, ampersands, etc. I tried to include the correct version, but the source is so garbled, I'm not sure what you intended :-).
Actually, you can check out Using PerlMonks code to clean up source code that's been printed with <PRE> tags. It's a little script I wrote to make PM code a bit easier to work with. However, you'll want to replace the last regex with the following: