in reply to pre-texted <STDIN>
you can play with Term::ReadLine to accomplish your task. The following oneliner is a windows version and you have to force the underlaying readline module setting PERL_RL ENV var and also TERM one to be empty (not DUMB as cmd.exe IS DUMB ;)
perl -MTerm::ReadLine -E "BEGIN{$ENV{PERL_RL}='Perl';$ENV{TERM}=''} $ +term = Term::ReadLine->new(); $txt='spaghetti,pomodoro,vino'; $txt=$t +erm->readline('edit:',$txt); say 'new:',$txt" edit:spaghetti,pomodoro,vino # you now edit the line erasing 'pomodor +o' and hit RETURN new:spaghetti, vino
To adapt to Linux use single quotes around the oneliiner and double quotes inside it; you can probably remove the BEGIN block too.
L*
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: pre-texted <STDIN> with Term::ReadLine -- oneliner
by ShainEdge (Novice) on Apr 04, 2020 at 13:24 UTC | |
by haukex (Archbishop) on Apr 04, 2020 at 16:29 UTC | |
|
Re^2: pre-texted <STDIN> with Term::ReadLine -- oneliner
by ShainEdge (Novice) on Apr 04, 2020 at 13:03 UTC | |
by Discipulus (Canon) on Apr 04, 2020 at 13:25 UTC |