Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

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

by DrHyde (Prior)
on Jul 23, 2014 at 10:31 UTC ( [id://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?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (6)
As of 2024-04-23 15:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found