Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: Passing ouput between program

by perigeeV (Hermit)
on Jul 16, 2001 at 16:00 UTC ( [id://96998]=note: print w/replies, xml ) Need Help??


in reply to Passing ouput between program

One way is to use open with a pipe.

open(TWO, "| /your/second/program") or die "Dead $1\n";

Now instead of printing to STDOUT, print to the filehandle you just made:

print TWO "data data data\n";

In your second program that data is read in as STDIN:

print while(<>);
will print out "data data data".

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (5)
As of 2024-04-24 08:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found