bdimych has asked for the wisdom of the Perl Monks concerning the following question:
How to catch such error and what is the first message?> > > cat 1.pl use strict; use IPC::Open2; my $cmd = '/no/such/command'; open2(my ($out, $in), $cmd) || die("I thought script should die here: +$!"); sleep 1; open(my $pipe, "$cmd|") || die("But it dies only here: $!"); > > > perl 1.pl open2: exec of /no/such/command failed at 1.pl line 4 But it dies only here: No such file or directory at 1.pl line 6. > > >
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Is it possible to detect "no file" error in open2 ?
by ikegami (Patriarch) on Dec 07, 2007 at 16:47 UTC | |
|
Re: Is it possible to detect "no file" error in open2 ?
by zentara (Cardinal) on Dec 07, 2007 at 18:04 UTC | |
|
Re: Is it possible to detect "no file" error in open2 ?
by Anonymous Monk on Dec 07, 2007 at 20:46 UTC | |
|
Re: Is it possible to detect "no file" error in open2 ?
by bdimych (Monk) on Dec 08, 2007 at 02:36 UTC |