Recently my emacs configuration on my iMac at the lab got messed up and was refusing to automatically use cperl-mode when editing perl files. Today I finally got get up and decided to see if I could fix it. The solution turned out to be adding the following line to my .emacs file:
(defun compilation-build-compilation-error-regexp-alist() (lambda()))