in reply to system() and output

After reading what you want from OUTPUT, close OUTPUT returns false if $myScript fails or exits with non-zero.

It also leaves the exit status in $?.

see perldoc -f close for more information.

Or you can use backquotes my $output = `$myScript`; which also leaves exit status in $?.

Replies are listed 'Best First'.
Re: Re: system() and output
by hotshot (Prior) on Aug 11, 2003 at 05:35 UTC
    In your first suggestion, you said:

    close OUTPUT returns false if $myScript fails or exits with non-zero

    myScript returns 0 on success and non zero on failure, which is the opposite of what close() returns, what is returned on success of myScript and does the non-zero you mentioned are myScript exit statuses?

    And another thing, in your second suggestion, does $output holds the stdout from myScript?

    Thanks again

    Hotshot