$ echo abc | perl -e'for (1..3) {print "Q$_ -> "; read STDIN,$r,1; print "$r\n"; sleep 2}' Q1 -> a Q2 -> b Q3 -> c