All pastes #795308 Raw Edit

hengha

public text v1 · immutable
#795308 ·published 2007-11-24 00:07 UTC
rendered paste body
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)))