Abigail#!/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 $
In reply to Re: Multiple STDIN sources
by Abigail-II
in thread Multiple STDIN sources
by perlfan
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |