Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical

Re: favorite perl mode for Emacs?

by Joost (Canon)
on Oct 24, 2009 at 09:54 UTC ( [id://803018] : note . print w/replies, xml ) Need Help??

in reply to favorite perl mode for Emacs?

As an alternative to perl-mode, there's also cperl-mode, which most people prefer and is I think also better maintained. There should be a cperl-mode in your emacs installation, but if you want more up-to-date/expermental versions, see the cperl-mode page on emacswiki.

Also: don't forget to switch on flymake-mode. It's one of the most useful tools in emacs, not just for perl:

;; Use cperl-mode for perl (add-to-list 'auto-mode-alist '("\\.\\([pP][Llm]\\|al\\)\\'" . cperl-m +ode)) (add-to-list 'interpreter-mode-alist '("perl" . cperl-mode)) (add-to-list 'interpreter-mode-alist '("perl5" . cperl-mode)) (add-to-list 'interpreter-mode-alist '("miniperl" . cperl-mode)) (add-hook 'cperl-mode-hook (lambda () (require 'flymake) (flymake-mode 1) ;; use flymake (local-set-key (kbd "C-h f") 'cperl-perldoc))) ;; use perldoc inst +ead of info on C-h f

You might also be interesed in Sepia and other stuff that turns up on CPAN

Replies are listed 'Best First'.
Re^2: favorite perl mode for Emacs?
by Anonymous Monk on Oct 24, 2009 at 21:20 UTC
    Which is more updated cperl-mode?

    One on emacs wiki or one on CPAN?

      The CPAN link (which is the 5.25 version distributed with perl 5.10) is older, at least according to the version number/date than the v6.2 one in the "official" distribution @ Ilya's site

      The other versions mentioned in emacswiki are probably based on/synched with the 6.2 version mentioned above, and may have some updates that ilya's version doesn't have, like more 5.10 syntax support.

      In any case you will get a cperl-mode distributed with both emacs and perl, and if you use fairly recent versions of either you should get at least one usable version of cperl-mode. If you want to get the best mode you can get, you should probably start with ilya's site and then explore the other links on emacswiki to see what version suits you most.

      As for me, I'm mostly writing perl 5.8 compatible code at the moment and Ilya's 6.2 version works fine for that.

        Beware: You should stick with the bundled cperl-mode version. Loading another version can cause strange problems.

        see fontification problem with PODs

        Better update to the newest emacs, the cvs trunk of 23 has already cperl 6.2 included.

        It's not necessarily caused by Ilya, the emacs-team is regularly changing details, even his code.

        Cheers Rolf