in reply to perl file permissions

Hi all,

I've been tinkering with my .vimrc file all afternoon and found a perfect solution to my permissions problem and thought I'd post it in case it can help someone else who uses vim to create perl files. It also puts in the #!/usr/bin/perl, use strict; and use warnings; lines:

I put the following line in my .vimrc file:
imap ,perl #!/usr/bin/perl<CR><CR>use strict;<CR>use warnings;<CR><CR> +<esc>:w<ENTER>:!chmod 755 %<ENTER><ENTER>i

(You also need to add 'set autoread' to your .vimrc file otherwise Vim will complain about the permissions change during editing.

Now all I have to do when I'm in a newly created file is go into '--INSERT--' mode and type ',perl' and the file gets filled out, saved, chmods it to 755 and returns you to '--INSERT--' mode at the bottom of the file, ready to start typing.
I hope others who use Vim may benefit from this as well. I'd like to know if anyone thinks this would come in handy.

I thank everyone for their assistance. This is one of the best Web sites for Perl I've ever seen.

Cheers, BadMagic