IPC::Cmd considered harmful - ETOOBUSY
Recently, I had to do some command-line invocations from Perl. Well, let’s see what we have at our disposal then…
- system is fine, but too limited. E.g. it does not allow grabbing the output of a command, which I might need;
- qx is a joke from the past. I mean, not having a list-oriented alternative and forcing the user to do (and possibly forget) quotemeta is something I can’t bear in 2021;
- IPC::Open2 and IPC::Open3 are in CORE but require some effort to be used, which I’d like to avoid;
- IPC::Cmd seems interesting, because it’s in CORE and its run_forked seems to hit the sweet spot: it supports providing the command as an array reference, has a bunch of options and provides back everything that’s needed;
- IPC::Run, IPC::Run3, insert your favourite module here all seem very interesting and flexible, but they are not in CORE and are probably overkill in my case.
Well then, we’re done! IPC::Cmd’s run_forked for the win… right?!?
Well… not so fast.
https://www.reddit.com/r/perl/comments/lu39cy/ipccmd_considered_harmful/
March 9, 2021 at 10:20:21 AM EST
*
FILLER