[grand-rapids-pm-announce] driving a process [using pipes?]

Cameron Walker cameron.walker at fedex.com
Tue Sep 27 06:41:44 PDT 2005


I have a process (specifically the sybase 'ic' process) that I want to 
send commands to and then recieve the output back for further processing.

I'm aware of how to send commands via
    open(wp,"| ic")
    print wp "sp_who"
    print wp "go"
etc and so on. On the other side I know how to read data in from a 
process via
    open(rp,"date |")
    $input = <rp>
However, I cant figure out how to make these work together at the same 
time. The 'ic' program apparently isnt smart enough for me to just feed 
it the data on the command line so I _have_ to open an input pipe to the 
thing in order to drive it. At this point my knowledge fails me. How do 
I get the data back out?

I started to do a fork and quickly realized that that doesnt seem to 
solve my problem. I've heard suggestions that I need to play with some 
filehandles to deal with this but clearly Im to dense to comprehend what 
I need to do.

If you have any ideas I would much appreciate a tip [ more like an 
'idiots guide' ].

Thanks.




More information about the grand-rapids-pm-announce mailing list