in reply to Re: Returning a bad status back to the parent UNIX process
in thread Returning a bad status back to the parent UNIX process

Thanks David, I would like to hold on the the errors so I'll know what to fix but in my case the xls file is being written out, less the bad records and the unix script doesn't know there is a problem. In my unix scipt I am call the perl scipt using return $? but the status seems to be coming back as a 0 value.
  • Comment on Re^2: Returning a bad status back to the parent UNIX process

Replies are listed 'Best First'.
Re^3: Returning a bad status back to the parent UNIX process
by derby (Abbot) on Jul 27, 2006 at 13:21 UTC

    I'm not following 100% (more code would be useful). But I think you should print errors to STDERR and in your calling script (or cmdline invoke), redirect STDOUT and STDERR to different files.

    -derby
Re^3: Returning a bad status back to the parent UNIX process
by Hue-Bond (Priest) on Jul 27, 2006 at 13:09 UTC

    $? is only useful if you're spawning other processes from Perl, using system, open and others. So if you're not doing this, it's very possible that you're indeed returning a 0 to the calling script. Why don't you return a simple 1 and let the calling script manage the error condition? Better try to post some code for making your problem a bit clearer.

    --
    David Serrano