Michael McQuarrie wrote: > > Hello all. Can't figure this out...I execute the following scipt and the output of >the KSH pipe > is placed at the top of the log file instead of in order of when it was executed. > ----------------------------------------------------------- > Script looks like this: > ----------------------------------------------------------- > #!/usr/bin/perl > my $PGPPATH = "/usr/local/pgp-6.5.1/keyrings"; > my $PGP = "/usr/local/pgp-6.5.1/pgp"; > open STDOUT, ">/home/michael/test1.log" or die; > open STDERR, ">&STDOUT" or die; > print "Beginning of script test1\n"; > open KSH, "|ksh" or die; > print KSH << "EOKSH"; > export PGPPATH=$PGPPATH > $PGP +force -e "/home/michael/file1.txt" testpgpkey > EOKSH > close KSH; > > ---------------------------------------------------------------- > Log file looks like this: > ---------------------------------------------------------------- > Pretty Good Privacy(tm) Version 6.5.1 > (c) 1999 Network Associates Inc. > Uses the BSafe(tm) Toolkit, which is copyright RSA Data Security, Inc. > Export of this software may be restricted by the U.S. government. > > Recipients' public key(s) will be used to encrypt. > > Key for user ID: testpgpkey > 1024-bit DSS key, Key ID 0x0F031FA4, created 2001/03/15 > > Ciphertext file: /home/michael/file1.txt.pgp > Beginning of script test1.
As I mentioned in an earlier thread, standard input and output are buffered. The example under the open() function in the perlfunc document that shows how to redirect STDOUT and STDERR also shows how to unbuffer I/O perldoc -f open Look for the select() function and the $| variable. John -- use Perl; program fulfillment -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
