[Date Index][Thread Index]
[Date Prev][Date Next][Thread Prev][Thread Next]

[1.99.4] BUG REPORT: system(3pl) doesn't return exit value



In wml_frontend/wml.src I find the following:

            $rc = system("$e $o");
            #   Tidy returns 1 on warnings and 2 on errors :(
            $rc = 0 if ($rc == 1 and $e =~ m|@libdir@/exec/wml_aux_tidy|);

This doesn't work like expected, because the perl system() call
doesn't return the exit value of the excuted command.  The perl
documentation (perldoc -f system) says:

 The return value is the exit status of the program as returned by the
 C<wait()> call.  To get the actual exit value divide by 256.  See
 also L</exec>.  This is I<NOT> what you want to use to capture the
 output from a command, for that you should use merely backticks or
 C<qx//>, as described in L<perlop/"`STRING`">.

So you have either to divide $rc by 256 or test $rc == 256 (instead of
$rc == 1).

Tschoeeee

        Roland

-- 
 * roland@spinnaker.de * http://www.spinnaker.de/ *
______________________________________________________________________
Website META Language (WML)                www.engelschall.com/sw/wml/
Official Support Mailing List                   sw-wml@engelschall.com
Automated List Manager                       majordomo@engelschall.com