System-Command reviews

RSS | Module Info

System-Command (1.108) *****

When you need to do something simple with an external command, Perl already hands you all the tools you need. There's the system() built-in, and of course backticks (a.k.a. the qx operator).

However, if things get more complex - for example you need to run a command and chat to it, passing data to its STDIN and receiving data from STDOUT - the code you need to write isn't quite as neat. These sorts of tasks can usually be accomplished by digging around in the IPC modules that come bundled with Perl, but you don't need to because BOOK has done that for you!

System::Command provides a very neat little object-oriented wrapper around launching and chatting to external processes. It provides convenient options for establishing the process' environment and working directory. Once the process is running, it will give you filehandles to interact with it.

For a while System::Command had problems on Windows which made it an unattractive prospect to those wanting to write cross-platform code, but these issues have been resolved now.