in reply to Re: once again: program output and return code
in thread once again: program output and return code

$@ is a shortcut to the return code from eval. and that i'm getting. it's the redirection that i can't figure out.

i assume you meant double-quotes around $tmp_stdout and $tmp_stderr. i ran your corrected code on Win32, and i can't get this to work there.

=Particle

  • Comment on Re: Re: once again: program output and return code

Replies are listed 'Best First'.
Re:{3} once again: program output and return code
by jeroenes (Priest) on Jun 07, 2001 at 19:31 UTC
    No, perlvar sayz:
    $@ The Perl syntax error message from the last eval() operator. If null, the last eval() parsed and executed correctly (although the operations you invoked may have failed in the normal fashion). (Mnemonic: Where was the syntax error "at"?) Warning messages are not collected in this variable. You can, however, set up a routine to process warnings by setting `$SIG{__WARN__}' as described below. Also see the Error Indicators entry elsewhere in this document.
    So that's something different (it returns the syntax error). use $ret=eval... for return values.

    And indeed, that redirection won't work under windows. But maybe a real shell helps in that respect: try cygwin or bash4win.

    Oh, and fixed those quotes. Sorry about that.

    Jeroen