chomp $ans; print "Got '$ans'\n"; print "stream = $stream"; #### $ ./stdin foo bar ^D Do you want to process the stream?yes Got 'yes' stream = foo bar $