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

Re: [MacPerl] Odd behavior on die()



>Hi All -
>
>I get two odd behaviors using the following code:

This is not MacPerl specific, but you are noticing a difference in Perl
implementations.  The general problem is output synchronization.

a) when STDERR and STDOUT are directed to the same place, presumably this
is how the NT server is handling things, although it seems kind of strange,
then generally STDERR will be output before STDOUT.

b) When an error occurs in another place, the STDERR output will be
interpreted as a "funny-looking header", and cause everything after it to
be treated as text. So the die() output will lead the print() output.

Synchronize the STDOUT stream using

$| = 1;

or a similar method described in the documentation.

Bob Dalgleish   bob.dalgleish@sk.sympatico.ca
Web Page        http://www.sasknet.com/~dalgl/