Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re^3: Is it possible to write to STDIN ?

by DrHyde (Prior)
on Jul 23, 2014 at 10:31 UTC ( #1094758=note: print w/replies, xml ) Need Help??


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.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1094758]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (5)
As of 2019-04-21 18:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I am most likely to install a new module from CPAN if:
















    Results (111 votes). Check out past polls.

    Notices?