Elizabeth Rice wrote:
!I am using a few TSO commands in my Perl script.
!
!When I let the output from my script go to the terminal it comes out on
the
!terminal in the order that it is producted.
!When I redirect the output to a file all the TSO ouput is at the top, and
my
!print statements follow in order.
!
!Is this an error in Perl on MVS or in the UNIX Shell on MVS?

Well you've notices a difference between the output of:

SYSM $ perl -w olaplog.pl

as opposed to:

SYSM $ perl -w olaplog.pl > olaplog.pl.out 2>&1

where the difference is directing output to a file and duplicating
error output to the same file.  This falls within the realm of
a difference in shell command so strictly speaking the answer is
it is not perl's fault.

That is not to that ther might not be somethings you could try playing
with in perl to help overcome the shell's or tso's dual behavior.  One
thing to be suspicious of is which file stream is being written to.
A way to test that would be:

SYSM $ perl -w olaplog.pl > olaplog.pl.out 2> olaplog.pl.err

and see if there is anything in the olaplog.pl.err file.
Another things to try is duping stderr to stdout within the
script explcitly, changing:

    print `tso $cmd`;

to something along the lines of:

    print `tso $cmd 2>&1`;

I hope that helps.

Peter Prymmer



Reply via email to