use Term::ReadLine; my $term = Term::ReadLine->new; while(<>) { chomp; print "Got line: \"$_\"\n"; } my $in = $term->readline("Input: "); print "Got input: \"$in\"\n";