• Shaarli
  • Tag cloud
  • Picture wall
  • Daily
  • RSS
  • Login
4253 shaares
Filters

IPC::Cmd considered harmful - ETOOBUSY

QRCode

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/

https://github.polettix.it/ETOOBUSY/2021/02/27/ipc-cmd-considered-harmful/
March 9, 2021 at 10:20:21 AM EST *
perl
FILLER
Shaarli · The personal, minimalist, super fast, database-free, bookmarking service by the Shaarli community · Documentation
Fold Fold all Expand Expand all Are you sure you want to delete this link? Are you sure you want to delete this tag? The personal, minimalist, super fast, database-free, bookmarking service by the Shaarli community