in reply to Doubled print with eval and open3
The open3 doesn't throw an exception so the eval doesn't catch it. Instead test $!:
$! = undef; $pid=open3($WRITE, $READ, $ERROR, "$command"); if (length $!) { $error="Error, Could not execute $command: $!"; } else {
If there are exceptions you want to catch that can be thrown then put the eval back in and add a elsif as appropriate.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Doubled print with eval and open3
by ikegami (Patriarch) on Mar 06, 2007 at 00:03 UTC | |
by GrandFather (Saint) on Mar 06, 2007 at 00:33 UTC | |
by ikegami (Patriarch) on Mar 06, 2007 at 00:52 UTC |