I added the following into dot emacs and tried C-p k in cperl-mode buffer, however it didnt check perl script syntax at all ,nothing showed up in minibuffer, any idea ? ;;check perl syntax (defun check-perl () (interactive) (setq perl-buffer-name buffer-file-name) ;;(shell-command (concat "perl -f " perl-buffer-name)) (compile (concat "perl -f " (buffer-file-name))) ) (add-hook 'cperl-mode-hook (lambda () (local-set-key (kbd "C-p k") 'check-perl)))