(global-set-key "\C-xt" 'perltidy-region) (setq shell-command-default-error-buffer "perltidy-errors") (defun perltidy-region () "Run the perltidy parser on the current region." (interactive) (let ((start (mark)) (end (point)) (command "perltidy")) (shell-command-on-region start end command t t shell-command-default-error-buffer)))