Oh, I see. In that case, just reopen STDIN, and read from
the terminal:
#!/usr/bin/perl -w
use strict;
$| = 1;
my $stream;
while (<>) {
$stream .= $_;
}
open STDIN, "/dev/tty" or die;
print "Do you want to process the stream? ";
my $ans = <STDIN>;
chomp $ans;
print "Got '$ans'\n";
print "stream = $stream";
#...
exit;
__END__
$ echo foo | ./stdin
Do you want to process the stream? yes
Got 'yes'
stream = foo
$
Abigail |