Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
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 imbibing at the Monastery: (4)
As of 2014-12-28 06:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (179 votes), past polls