When writing the Perl program with Emacs, there is a shortcut to run the Perl program that is writing directly, it is very convenient.
Add the following code to ~ / .emacs, the Perl program you are writing can use M-O to run.
(Defun RunperL ()
"Run Perl, execute the Perl program of the current buffer"
(Interactive)
Save-buffer
(LET (FileName Buffer-file-name)
(cmd ")
(Current-buffer)
(End (Point-max)))))
(if FileName
Save-buffer
(Save-ExcURSION
(SetQ filename (Concat (GetENV "TMP") "/TEMP.PL"))
(Set-buffer (Create-file-buffer filename))
(INSERT-BUFFER-SUBSTRING OLDBUF 1 END)
(Write-file filename)
(Current-buffer))))))))
(SetQ cmd (control "perl -w" filename))
(Message "% s ..." cmd)
(Shell-Command CMD))))))
(GLOBAL-SET-Key [(Meta O)] 'Runperl); Bind-Key Alt O: Runperl