Hi kschwab

> Then, just run "rlwrap perl" instead of "perl", and it should do what you want.

Thanks, I knew rlwrap and it's already installed. :)

I erroneously thought that on Win I'm able to navigate the whole chunk of code from the last call to perl instead of just reconstruction line after line.

But it turns out I was wrong.

Probably there is an option for rlwrap to treat the whole chunk as one line. Have to look into it.

For me there is a gap to be filled between improvised one-liners and persistent scripts.

I also tried putting all into a bash heredoc but either my bash foo is too weak or interactive input is treating heredocs differently

$ perl -e <<___ if(1) { print 44; } ___ No code specified for -e.

EDIT:

But while composing this post I noticed that this syntax does what I want:

$ perl <<___ if(1) { print 44; } ___ 44 # arrow up $ perl <<___ if(1) { print 44; } ___

Of course on bash only :(

update

unfortunately the "solution" I found is messing up STDIN pipes

lanx@lanx-1005HA:/tmp$ ls |perl -n <<___ print if /a/ ___ lanx@lanx-1005HA:/tmp$ ls |perl -ne ' print if /a/ ' atop.d at-spi2 mkinitramfs_JrDw4Q mkinitramfs-OL_Ahxk1r

Cheers Rolf
(addicted to the Perl Programming Language and ☆☆☆☆ :)
Je suis Charlie!


In reply to Re^2: Navigating history of STDIN-multiliners after 'perl RET' by LanX
in thread Navigating history of STDIN-multiliners after 'perl RET' by LanX

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.