Hi, Thanks for the answers, my favorite version is a mix out of different answers and it works great so far, here it is:
select(STDERR); $| = 1; select(STDOUT); $| = 1; and I start the script with: script.pl >>logfile.txt 2>&1 Bill, the - open STDERR, ">&STDOUT"; - command is not working, the output is comming to the console and not to the file. Again, Thanks for the help. > -----Original Message----- > From: Wening Andreas > Sent: Thursday, June 06, 2002 1:56 PM > To: '[EMAIL PROTECTED]' > Subject: redirection of STDERR > > Hi all, > > I posted a similar question a while ago but the answers didn't really > resolve my problem. > > I want to redirect all output in a file. Therefore I start my script like: > myscript.pl >>logfile.txt > > That works fine for STDOUT but all error messages don't get into that > file, no I got the suggestion to do: > myscript.pl >>logfile.txt 2>&1 > > That adds the STDERR output to my file but not at the right time. So my > log file contains all the STDOUT output and then all the STDERR output. I > want to have the errormessages exactly then written to the logfile when > they happen and I'm wondering if I can redirect the stream to STDOUT like: > open STDERR, ">> STDOUT" > > But this didn't work. I also tried to write to the same file like: > open STDERR, ">> logfile.txt"; > but this didn't work too (I guess I can assign a file only to one output > stream). > > Can anybody help? > > Andreas > > > _______________________________________________ Perl-Win32-Admin mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs