(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)))