in reply to windows linux and perl

As far as I know, that's only a CLI behavior in both Windows and Linux - and the input line of a Perl script is not a C(ommand)L(ine)I(nterface). As kyle mentioned, Term::ReadLine will provide input history and other features; it's a pretty capable module.

Here's an example of how you might do something like what you're looking for:

#!/usr/bin/perl -w use strict; use Term::ReadLine; my $term = new Term::ReadLine 'Yes/No'; my $OUT = $term -> OUT || \*STDOUT; while ( my $answer = $term -> readline( "Yea or Nay? " ) ) { print $answer =~ /^yea$/i ? "Yup.\n" : "Dough!\n"; }

--
"Language shapes the way we think, and determines what we can think about."
-- B. L. Whorf