All the Perl that's Practical to Extract and Report

Navigation

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
Without JavaScript enabled, you might want to
use the classic discussion system instead. If you login, you can remember this preference.

Please Log In to Continue

I think it's worthwhile to think about what should happen if someone passes you a Perl filehandle, then closes it before EndDocument().

What would happen with a duped filehandle? Would the duped one stay open if the original one gets closed?

I think that it should behave the way a pure-Perl module mostly like would: closing the filehandle closes it out from under the module, too. The duping behaviour seems safer, but I worry that this “safety” net could veil bugs in client code, in which case I'd prefer dumb behaviour that blows up in a user's face as soon as they do something stupid.

Unfortunately, that behaviour caused a segfault in some cases, which is why I was so keen to avoid it. I've worked around it by storing the file handle in a hash in the latest version, and releasing it when EndDocument() is called.

It might do, it might not. The behaviour was extremely variable and core dumped on some boxes but not others. Given the unpredicatbility, I felt that it was the right thing to do to store a reference to the filehandle until we're done with it.