Nicholas Clark <[EMAIL PROTECTED]> writes:
>On Wed, Mar 20, 2002 at 09:13:11PM +0800, Stas Bekman wrote:
>> Nick Ing-Simmons wrote:
>
>> > For lexicals like your $stdout it is a glob ref - what you have there
>> > stringifies it and there isn't a file handle called GLOB(0x12345678)
>> > so it fails - you need to use three-arg form:
>> >
>> >        open STDOUT ,">&",$stdout
>> >
>> > should work.
>>
>> well I was writing a patch for perlfunc, and then I've tested it -- it
>> doesn't work,
>>
>>    open STDOUT ,">&" . fileno($stdout)
>>
>> as suggested by Rafael does work, but that's ugly and not perlish :(

Quite.

>>
>> Neither the code in perlfunc open()'s section's example works, somebody
>> changed the old working code without testing and broke it.
>
>1: To me this specific thing sounds like a serious bug.
>   (scoring +1 because it breaks a documentation example, and +1 because
>    the $someone who hacked the core in the area thinks it should work, but
>    it doesn't)

One $someone that changed it was me. I thought I had tested it and it worked
at the time - it is still not entirely clear why it doesn't - it is
going through all the motions - dup(2)-ing things all over the place.
I suspect that a patch for threading-dup stuff has tangled with
an n-arg-open and perlio patch...


>
>2: (For the perl-qa people) Is there a workable solution yet to making
>   a tool to auto-test all the code examples in the pod?
>
>3: And if so can it detect code that is added without tests?
>   (as opposed to code added with an explicit "exempt this code from testing)
>
>Nicholas Clark
--
Nick Ing-Simmons
http://www.ni-s.u-net.com/



Reply via email to