System Functions Perl

use Term::ReadLine;
$term = Term::ReadLine->new("Input");
$prompt = "%";
while (($line = $term->readline($prompt)) ne 'q') {
    $term->addhistory($line);
    print "You typed: $line\n";
}