use Term::ReadLine; my $term = Term::ReadLine->new; while(<>) { chomp; print "Got line: \"$_\"\n"; } my $in = $term->readline("Input: "); print "Got input: \"$in\"\n"; #### $ echo -e "Hello\nWorld" | perl in.pl Got line: "Hello" Got line: "World" Input: test Got input: "test"