in reply to Read System output Into a variable Name?
Other monks have already mentioned the backticks and qx() operators, which are explained in the "Quote and Quote-like Operators" section of the perlop man page.
The perlipc man page talks about all sorts of different ways to do things, and the IPC::Open2 and IPC::Open3 modules are good too.
If you want the data back as one chunk, the backticks probably are what you want. If you can do things line by line, or the external process outputs lines slowly, you probably want open() with a pipe. If you have to deal with STDERR too, and maybe write something to the process, you probably want one of the IPC:: modules (some programs seem to want me to close their STDIN before they write anything). Figure out which one works for your situation, and good luck :)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Read System output Into a variable Name?
by Grundle (Scribe) on Feb 01, 2005 at 20:32 UTC |