;; http://perlmonks.org/index.pl?node_id=188959 ; run perl on the current region, updating the region (defun perl-replace-region (start end) "Apply perl command to region" (interactive "r") (shell-command-on-region start end (read-from-minibuffer "Replace region command: " '("perl -ple \'$_=eval\'" . 12 )) t t ) (exchange-point-and-mark) )