Argh… Emacs/Win7 and Perl …

I’ve recently converted to using Emacs in work and home. I like the idea of the extensibility and of all the preloaded packages. Unfortunately, it has a steep learning curve when trying to configure the details. I’m still impressed but it can be a little challenging to get info on Win7 usage.

I’ve found lots of information from EmacsWiki and an exemplary blog called Emacs-fu. I’m actually pretty happy with the basic set-up but I did decide to install the latest version of orgmode and org2blog. I also installed built and installed w3m in order to read html mail through the built in gnus package. At this point I was feeling very self-satisfied and convinced that I was ready to begin programming.

I thought I would start with something simple….

Perls of wisdom

I use perl a lot on the job. As a rough but powerful tool, nothing beats it. I have never used Emacs with perl except as an editor and I didn’t want to spend too much time on the task of customization until I get a feel for what’s possible The following lisp function on perlmonks gave me a start. It starts the perl syntax check in a separate buffer with the error messages… very neat.

The rocky road to enlightenment

I had problems with Perl syntax checking. I was getting locale warnings but soon found some useful input on Stack Exchange. After setting LC_ALL (to de_DE in my case), the warnings disappeared

Execution is everything

Ok, so now I’m able to check the syntax but what about running. Both M-! and M-x shell allow me to call the perl interpreter but when I call a script it freezes the buffer. Keys are echoed but I get nothing useful back…. Very annoying. Another look at the stack exchange entry provides the answer. NUL is required. But why?

Open points…

I tried to figure this out in 30 min and it wasn’t enough. The M-x compile function has the same problem as shell and eshell. I also want to find out how to get the errors parsed so that the next error function works with the interpreter output. I’m going to leave that for another time.

Update 2013-01-27 So

I found a reference on how to run the perl debugger here. ‘M-x perldb’ prompts for input with Run perl like this: perl -d <script name>. It opens a new buffer for the output and shows a cursor mark on the original script to show the current line of execution. It’s also possible to remove the -d flag to capture script output but it’s definitely a kludge.

This entry was posted in Programming and tagged , , , , . Bookmark the permalink.

Leave a comment