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. > > >
In reply to Is it possible to detect "no file" error in open2 ? by bdimych
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |