http://qs321.pair.com?node_id=164003

mothra has asked for the wisdom of the Perl Monks concerning the following question:

Ugh.

After searching and searching I've had no luck in finding out the tricks to being the most productive in Emacs with cperl-mode. The information laid out in C-h m for cperl-mode isn't of much use either, because it doesn't address the questions I have.

Specifically, the following (long) list of questions remain unanswered:

  1. How do I run a perl program from Emacs in Windows? How about a program for which I don't want the console window to be shown (IOW, run with wperl.exe, on Win32)?

  2. How do I turn on the feature so that when I hit RET, the cursor automatically lines up with the current indentation on the next line?

  3. How can I make backspace back up by one level of indentation?

  4. How can I make sub foo {'s be automatically closed with }'s, a newline automatically inserted after the opening {, and the cursor correctly indented?

  5. How can I run perldoc on windows? (M-x cperl-perldoc breaks by default, because it trys to run perldoc with a bash shell)

  6. How can I format calls like:
    Foo::Bar->new(-baz => 1, -moo => 2);
    into:
    Foo::Bar->new( -baz => 1, -moo => 2 );
    with a command?

  7. How can I fold/collapse all sub's matching a regex pattern?

  8. Where can I find syntax highlighting configurations that don't suck? (I find the default colors ugly :)

I know this is more an Emacs question than a Perl one, but realistically, I'm far more likely to get useful answers from Perl programmers than more general "Emacs users".

As well, I'd be more than willing to take any information about cperl-mode producitivity gained from this node (and from the bits and pieces of other nodes about Emacs on PM, that don't answer the questions above) and write a tutorial out of it (because I wanted one, but such a thing doesn't exist it would seem).

Any help, and any further tips and tricks would be much appreciated.