CarolinaPerler has asked for the wisdom of the Perl Monks concerning the following question:
Using IPC::Run.
Would like to examine all the built-in special error variables: $@, $!, $^E, and $?. After an IPC::Run 'run', when I try to check $! and $^E, I get 'Illegal seek'.
run (\@commandArray, \$in, \$error, timeout(3)); print "LIB LEVEL ERROR: $!\n"; print "OS LEVEL ERROR: $^E\n";
On some systems in some situations, $^E is not supported. But, $! should be available. IPC::Run hands back $error (given the code above). But, it does not necessarily give back all the detail that can be gleaned from cruising through the built-in error vars. I like using IPC::Run and would like to continue doing so. But, need a robust mechanism for catching error info. It appears that IPC::Run is monkeying with $! and $^E. Any ideas on how to capture the error detail after an IPC::Run run call?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: error variables after IPC::Run
by haukex (Archbishop) on Jun 19, 2017 at 19:02 UTC | |
|
Re: error variables after IPC::Run
by BrowserUk (Patriarch) on Jun 19, 2017 at 15:55 UTC | |
|
Re: error variables after IPC::Run
by choroba (Cardinal) on Jun 19, 2017 at 15:59 UTC | |
|
Re: error variables after IPC::Run
by karlgoethebier (Abbot) on Jun 19, 2017 at 16:01 UTC |