Pardus has asked for the wisdom of the Perl Monks concerning the following question:
My problem is this: in order to realize case 3 I should know whether there is a pipeline printing to STDIN or not. If so I obvious need a while (<STDIN>) {...} loop. _But_ using this loop without knowing there is a pipeline will cause the program to hang till it gets an EOF on STDIN (which it obviously won't get).if (-t STDIN && -t STDOUT) {...} # case 1
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: detecting a pipeline on STDIN
by pfaut (Priest) on Mar 15, 2003 at 21:18 UTC | |
by Pardus (Pilgrim) on Mar 15, 2003 at 21:25 UTC | |
|
Re: detecting a pipeline on STDIN
by dakkar (Hermit) on Mar 16, 2003 at 18:14 UTC |