in reply to IPC::Open2 failures

AFAIK IPC::Open2 does a fork/exec and only returns the result of the fork, so it's not really possible to find out if it didn't happen properly. You could do something like
do { open2(bla, bla, bla) } if (-e $PROGRAM and -x $PROGRAM)
maybe. That would only eliminate a couple of things and leave plenty of room for $PROGRAM to croak for other reasons, tho. You could also handle the fork yourself, but that might get hairy.

Replies are listed 'Best First'.
Re^2: IPC::Open2 failures
by El Linko (Beadle) on Apr 08, 2005 at 17:46 UTC
    That is probably what I'll do. Loads of stuff can go wrong but -f and -x covers what is most likely to go wrong. I may throw in a ps | grep $program name to crudely cover anything else.