Say I am editing a Perl file or buffer in Emacs in the default Perl mode (the one that comes with Emacs 23.1.1).
Is there a way to directly send the full file (or buffer) to the Perl interpreter and see the result (on a separate buffer)?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
There are third party modes for running inferior perl processes and interacting with them (e.g.
inf-perl.el), but nothing that comes included with emacs 23.1.1.However, an easy way to run your buffer with perl is with
shell-command-on-region. For example, this function will run perl on your buffer and display the output in a buffer called*Perl Output*:Run it in a perl buffer with M-x perl-on-buffer or bind it to a key like so:
Another option is to use
compile/recompilewithperl <filename>as the compile command. This works on the file contents rather than the buffer contents, and has the added advantage of navigating errors with C-x`(next-error).