in reply to Re: Re: Re: Capturing STDERR with -
in thread Capturing STDERR with -

Interesting. What operating system are you using? This doesn't work under Solaris 8. I added the open() statement to my script again and ran this:
print "OUTPUT: $_" for nslookup("blah.", "A");
Here's the output:
*** ns1.coxmail.com can't find blah.: Non-existent host/domain OUTPUT: Server: ns1.coxmail.com OUTPUT: Address: 206.157.231.13 OUTPUT:
STDERR still goes to my console.

Regarding the splice, it's to get rid of the three lines you see output there (Server, Address, and a blank). 'host' and 'dig' do not ship with Solaris 8.

-Matt

Replies are listed 'Best First'.
Re: Re: Re: Re: Re: Capturing STDERR with -
by Fastolfe (Vicar) on Dec 08, 2001 at 03:00 UTC
    Both Linux/2.4 (i686) and Solaris 7 (SunOS 5.6, Sparc) work as expected with the code and output I tried, under Perl 5.6.1.