in reply to Re^2: How do I pipe the output of a Perl program to something else?
in thread How do I pipe the output of a Perl program to something else?

I'd recommend going with the excellent suggestions from graff.

However, if you really are stuck prompting, you may be able to use IO::Prompt. I installed it and tried it out quickly.

use IO::Prompt; prompt 'What say you? '; print "user say '$_'\n";

If I run this with no arguments, it prompts and outputs the line as expected. If I run it and redirect to a file, it prompts, and the output goes to the file. I believe IO::Prompt achieves this by opening the user's tty directly.

  • Comment on Re^3: How do I pipe the output of a Perl program to something else?
  • Download Code