in reply to open with a command
What you are looking for is a way to do IPC, correct? If you are wanting to learn the details of how to do IPC (sort of like using LWP vs. WWW::Mechanize), there are two standard modules that will help you do this: IPC::Open2 and IPC::Open3. Be forwarned though, these are waters frought with deadlock and race conditions.
Of the two modules mentioned, IPC::Open2 is marginally safer to use (if you don't mind ignoring the other processes STDERR). Also, the filehandle order is different for each module:
$pid = open2(\*READ_FH, \*WRITE_FH, "command -args");
$pid = open3(\*WRITE_FH, \*READ_FH, \*ERR_FH, "command -args");
|
|---|