C-x h C-u M-| perltidy
####
(defun my-perltidy ()
"Call perltidy on the current buffer.
This replaces the current content of the buffer with the output of the
perltidy programm. You must have perltidy installed.
See http://perlmonks.org/?node_id=399154 for the start of this."
(interactive)
(when (yes-or-no-p "Really run perltidy? ")
(goto-char (point-min))
(shell-command-on-region (point-min)
(point-max)
"perltidy"
nil
t)))
##
##
(add-hook 'cperl-mode-hook
'(lambda ()
(local-set-key '[(control c) (control t)] 'my-perltidy)))