Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: making perl interactive with VI

by Paladin (Vicar)
on Feb 17, 2004 at 19:15 UTC ( #329689=note: print w/replies, xml ) Need Help??


in reply to making perl interactive with VI

#!/usr/bin/perl print ++$i, " $_" for <>;
Put the above in a file, make it executable, and call it within vi as :1,17!script and it adds numbers to the lines you selected. Should be simple to go from there to whatever you want perl to do to those lines.

The line you select in vi will be fed to your script on STDIN and vi will replace those lines with whatever your script outputs.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (3)
As of 2020-10-25 07:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My favourite web site is:












    Results (249 votes). Check out past polls.

    Notices?