hot9000 has asked for the wisdom of the Perl Monks concerning the following question:

I know this is a bad title as I don't know how to describe it (hence my google searches yield nothing).

Here is an example of what I want to do. I would like to write a program that accepts a big chunk of data and then ask user if s/he wants to print it.

Usage: any-program-that-writes-to-stdout | confirm_to_print.pl

where confirm_to_print.pl, which I am trying to write, reads from stdin from the left and at the end, still is able to ask:

"Press y to continue, any other key to cancel: y/n? "

How do I do it? Thanks a lot.

  • Comment on how to make perl finish reading piped in stdin and then continue to read from real user
  • Select or Download Code

Replies are listed 'Best First'.
Re: how to make perl finish reading piped in stdin and then continue to read from real user
by Marshall (Canon) on Jan 25, 2012 at 01:24 UTC
      Cool. Thanks a lot! I got it to work :)