On Jan 10, 2018, at 16:12, Rob Landry <[email protected]> wrote:

> I noiced yesterday while debugging a Perl script that includes an rdimpot 
> command that doing this:
> 
> if (system("rdimport...")) {
>  [import failed]
> } else {
>  [import succeeded]
> }
> 
> ...doesn't work. I saw a series of "missing or invalid group" messages, yet 
> the script behaves as if the import succeeded and gos merrily on its way.
> 
> Should I be attempting this differently?

Bear in mind that Perl’s system() call is similar to the ANSI C version —i.e. 
its return value is encoded as with wait(2). To get the ‘real’ exit code of the 
program you’ve called, you need to do some additional processing — it is *not* 
enough merely to look for a non-zero return to signal an error. See:

        http://perldoc.perl.org/functions/system.html

Cheers!


|----------------------------------------------------------------------|
| Frederick F. Gleason, Jr. |              Chief Developer             |
|                           |              Paravel Systems             |
|----------------------------------------------------------------------|
|          A room without books is like a body without a soul.         |
|                                         -- Cicero                    |
|----------------------------------------------------------------------|
_______________________________________________
Rivendell-dev mailing list
[email protected]
http://caspian.paravelsystems.com/mailman/listinfo/rivendell-dev

Reply via email to