Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: How to write out a Perl script and run it in as few keystrokes as possible.

by tobyink (Abbot)
on Sep 24, 2012 at 22:59 UTC ( #995451=note: print w/ replies, xml ) Need Help??


in reply to How to write out a Perl script and run it in as few keystrokes as possible.

You can execute a shell command in vim using:

:!command

Vim substitutes % in the command for the currently edited file, thus the following can be used to run the current script (assuming it's chmodded correctly and has a shebang):

:!./%

Via .vimrc you can create a shortcut for that.

... or to create a shortcut which saves first, then runs:

command R w | !./%

And another (hey, TIMTOWTDI):

nmap <F5> :w<cr>:!./%<cr>

(which maps the F5 key to do the duty.)

perl -E'sub Monkey::do{say$_,for@_,do{($monkey=[caller(0)]->[3])=~s{::}{ }and$monkey}}"Monkey say"->Monkey::do'


Comment on Re: How to write out a Perl script and run it in as few keystrokes as possible.
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://995451]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (5)
As of 2015-07-07 04:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (87 votes), past polls