perl -MTerm::ReadLine -E "BEGIN{$ENV{PERL_RL}='Perl';$ENV{TERM}=''} $term = Term::ReadLine->new(); $txt='spaghetti,pomodoro,vino'; $txt=$term->readline('edit:',$txt); say 'new:',$txt" edit:spaghetti,pomodoro,vino # you now edit the line erasing 'pomodoro' and hit RETURN new:spaghetti, vino