in reply to How to preserve the value of STDIN
I saved it as 'dup.pl' and called it with cat dup.pl | ./dup.pl.#!/usr/bin/perl -w use strict; open (NEWIN, "<&STDIN") or die "$!"; open (STDIN, "/dev/null"); print while (<NEWIN>);
(Find out about <& at open.)
Of course, you can pass a reference to a typeglob containing the NEWIN fh to the CGI.pm constructor...
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
RE: Re: How to preserve the value of STDIN
by Fastolfe (Vicar) on Sep 22, 2000 at 03:10 UTC |