Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: specifying STDIN for backticks

by CubicSpline (Friar)
on Oct 29, 2002 at 18:46 UTC ( [id://208821]=note: print w/replies, xml ) Need Help??


in reply to specifying STDIN for backticks

I sometimes need to do this when driving another application from perl that I don't actually control. Really, the right way to do this would be to modify your "second.pl" script to be smarter about the way it takes input, but that's another post.

Try the following:

#run the perl interpreter and open it's STDIN like a filehandle open PL, "|perl second.pl"; # whatever your loop/control structure is goes here while() { . . #print your input to the "filehandle", this has the effect #of sending your input via STDIN to the script print PL "Something"; . . } close PL;
HTH =)

~CubicSpline
"No one tosses a Dwarf!"

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (3)
As of 2024-04-25 17:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found