Perl uses '#' as an introduction for a comment, but also as a format specification. This produces problems in the syntax highlighting in the listings-package. How can I fix it?
\documentclass{article}
\usepackage{listings}
\usepackage{xcolor}
\begin{document}
\lstset{language=perl,commentstyle=\color{red}}
\begin{lstlisting}
#this is a comment
my $n=89;
#the "@###.####" is NOT a comment
format OUT=
@###.#####
$n
.
\end{lstlisting}
\end{document}