Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Click here to return to the 'Inline Perl code in shell - use zsh' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Inline Perl code in shell - use zsh
Authored by: hibbelig on Sep 16, '10 02:20:06PM

For longish inline Perl code in the shell, I think zsh is cool. You can enter this:

perl -e '

And then you can type Ctrl-V Ctrl-J which lets you enter a new line.
And from then on Ctrl-N/Ctrl-P and cursor down/up will move up and down by lines, instead of moving around in the history.
You can then enter your Perl code in multiple lines and then close the string and hit Enter and there you are.

I'm not sure how moving around in the history and moving around in multi-line commands interacts, but I recall it was pretty intuitive.

Of course, all this does not depend on the terminal.

[ Reply to This | # ]