Here, in a nutshell, is my experience of executing a command from perl with minimum fuss and maximum portability:
1. Use system or qx.
2. Get frustrated by limitations of the builtins (or tired of intoning strange POSIX incantations in Latin) and head to CPAN.
3. Quickly find a decent module with good reviews. In my case, there have been several of these over the years. Most recently, IPC::Run and IPC::Cmd. These work well most of the time, particularly on *nixes.
4. Find a common case that one of these modules doesn't handle well, if at all.
5. Wearily fire up another CPAN search, assuming there'll be nothing suitable listed under the 60-odd results returned for distros containing "IPC".
6. Find IPC::System::Simple.
7. Skip through the documentation. Test and verify. Remove boilerplate error massaging/translation code, FIXMEs, TODOs and WTFs.
3 out of 3 found this review helpful. Was this review helpful to you? Yes No
It strikes me as strange that this module hasn't been rated any stars yet.
It's simple to use the module, and yet it covers the advanced usage.
In addition, the module should work well under almost any platforms, even Windows.
You would presumably not be at a loss as to what modules relevant to IPC to use.
1 out of 1 found this review helpful. Was this review helpful to you? Yes No