http://www.perlmonks.org?node_id=1094758


in reply to Re^2: Is it possible to write to STDIN ?
in thread Is it possible to write to STDIN ?

You could close STDIN and re-open it as a normal filehandle:
close(STDIN); open(STDIN, 'foo'); print $_ foreach(<STDIN>);
The documentation for 'open' shows how to save and restore filehandles, and some other dirty tricks you can play.