from a command line 2> will redirect standard error. open(STDERR,">err.out"); works fine, thanks
-----Original Message----- From: Timothy Johnson [mailto:[EMAIL PROTECTED]] Sent: Tuesday, January 29, 2002 10:50 AM To: 'Kipp, James '; [EMAIL PROTECTED] Subject: RE: Redirect error to file using system() Maybe I'm missing something, but it looks like your problem is that you're redirecting STDOUT to a file, but STDERR is still going to the screen. There are two things I can think of that might help you out. One would be to include a statement like this: open(STDERR,">err.out"); This should redirect STDERR to the file. The second method may actually work better since it avoids shelling out to a separate command. It is to check out the Win32::Message module at http://www.roth.net/perl. -----Original Message----- From: Kipp, James To: [EMAIL PROTECTED] Sent: 1/29/02 7:38 AM Subject: Redirect error to file using system() Hi I am working on an NT script which uses system(). I can not get it to write errors to stderr instead of stdout. it works fine from the command line. see code snip below. any ideas? thanks Jim -- foreach $user (@users) { system("NET SEND $user testing 2>err.out"); } --- -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] ---------------------------------------------------------------------------- ---- This email may contain confidential and privileged material for the sole use of the intended recipient. If you are not the intended recipient, please contact the sender and delete all copies. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]