
Changing STDERR for an open pipe statement (How ?)
I'm still on 5.001 but I don't think that this should affect my
query.
I'd like to stop a programs 'stderr' output appearing on the
screen when I run the program from perl as a pipe, eg
open(FH,"program |") || die "program ???";
In Bourne shell speak I could run program
program 2>/dev/null
to get rid of its tiresome messages and that's what I'd like
to do here.
I have tried the following but it didn't do me any good,
open(SAVEIT,">&STDERR");
open(STDERR,">/dev/null");
select(STDERR); $| = 1;
open(FH,"program |") || die "die die";
while( <FH> ) { etc etc ;}
close(STDERR);
open(STDERR,">&SAVEIT");
Can anyone out there suggest some other way ?
Regards,
Bill
--
____________________________________________________________
Philips Research , Redhill , Surrey , UK