drawde83 has asked for the wisdom of the Perl Monks concerning the following question:
Hi I have a function that returns a string with multiple lines in it. This is a configuration for another program that I can run using a backtick shell. It gets the configuration through Standard input. whats the best way to get the input data into the other program?
I could probably do something likemy $data = function(); $ result = `echo $data | program`;
but I would have thought that there'd be a better way than using the echo command. I could treat it as a filehandle but then I'd be limited to only inputing data to the command or recieving it's output and I want to do both.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: piping a function into a backtick shell
by Tanktalus (Canon) on Jun 14, 2006 at 00:18 UTC | |
|
Re: piping a function into a backtick shell
by rodion (Chaplain) on Jun 14, 2006 at 02:15 UTC | |
|
Re: piping a function into a backtick shell
by graff (Chancellor) on Jun 14, 2006 at 03:59 UTC | |
|
Re: piping a function into a backtick shell
by Moron (Curate) on Jun 14, 2006 at 10:11 UTC |