in reply to Re^3: How to pass data as STDIN to Capture::Tiny
in thread How to pass data as STDIN to Capture::Tiny

Hi Ken,

Usually I tend to code defensively, especially when it comes to running external commands, I like to know every single time something goes wrong - I'm one of those people who usually looks at all the mails I get from e.g. cron :-)

Having had problems with autodie in the past, I tend to avoid it nowadays, and write the error handling myself. Unfortunately, at the moment I don't recall the specific problems (other than this particular case) I had with it, just that it was "spooky action-at-a-distance" type stuff.

On the other hand, I've also had problems with piped opens, such as it not working when given a Readonly variable (which I reported back then). The other reason I don't use piped opens anymore is that I've found that I'm usually not just interested in the command's STDOUT, but also its STDERR. (One of my modules, IPC::Run3::Shell, even includes a fail_on_stderr option, which considers any output to STDERR an error condition, something I've used frequently.)

So having been burned a little by autodie, Readonly, and piped opens, I instead, respectively, write the error handling myself, give the user just enough rope to shoot themselves in the foot, and use modules like IPC::System::Simple, Capture::Tiny, and IPC::Run3 instead :-)

Regards,
-- Hauke D