Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
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
Domain Nodelet?
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 perusing the Monastery: (5)
As of 2023-03-25 18:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Which type of climate do you prefer to live in?






    Results (63 votes). Check out past polls.

    Notices?