in reply to Simulating Command Line History in Perl
It seems to me you want a command history. This is what the Term::ReadLine modules do.