On Sun, Apr 21, 2002 at 01:45:27PM +0200, Elias Assmann wrote:

> If the Perl script is the last thing the batch file executes, I don't
> really see a problem, since you could just let the Perl script emit
> the error/success message. That might leave you with the problem of
> exiting the batch script with the correct exit code, but I don't know
> how the NT shell does these things (Bash shells exit with the exit
> code their last command exited with IIRC; an eval might also take care
> of the problem).

But the old DOS shells don't have 'eval' either.

> If the future course of actions of the batch script depends on the
> success/failure of the Perl script, then you could do that with a
> temporary file, like Micheal suggested, or you might also ressort to
> exit codes -- there has to be *some* way to capture them, don't you
> think?

The exit code can be found in the $ERRORLEVEL environment variable on
DOS shells.

> Or you could pipe the output of the Perl script to another script (be
> it Perl or batch or what-not) that could interpret it...

Not necessarily, since you can't redirect STDERR with the DOS shell.

> But really,
> I'd just get rid of the NT shell and re-write the thing in all-Perl
> :-)

Yepp, Ditto.  Or at least install Cygwin...

-- 
                       If we fail, we will lose the war.

Michael Lamertz                        |      +49 221 445420 / +49 171 6900 310
Nordstr. 49                            |                       [EMAIL PROTECTED]
50733 Cologne                          |                 http://www.lamertz.net
Germany                                |               http://www.perl-ronin.de 

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to