I often write small perl scripts to solve various problem of to explore perl behavior.
I use templates for .pl files which is nice. it autopopulates the basics into my buffer.
A small annoyance is that whenever I do this, before running it, I have to
chmod ugo+x
Can I get emacs to do this automagically for me (based on the file extension)?
How about the solutions offered on this page, they key off the fact that the file begins with
#!. There’s also a package that does this, shebang.el (which I happen to use). You could easily change the code to make the condition that the file name extension be.pl, but looking for#!is probably more generic.