Looking at that code they probably didn't actually have a professional Perl developer on staff. The code isn't terrible, but certainly a far cry from good. It doesn't help that back in 2005 all the books for learning Perl were still teaching a code style from the early 90s.
Edit: I revise the terrible bit, it's a little terrible, as it has SQL injections.
Edit: I revise the terrible bit, it's a little terrible, as it has SQL injections.