[feature] Provide a way to tell Perl not to close() a handle’s file descriptor
Nobody has claimed this yet.
- Dominant language
- Perl
- Stars
- 2.3k
- Forks
- 646
- Avg merge
- 2d 22h
- Merged PRs (30d)
- 49
Description
Per discussion just now with @Perl/perl-contributor
It’s a frustration point that, if you do:
open my $fh, '>>&=', $fd;
… Perl will close() the file descriptor once $fh is garbage-collected. While that’s useful behavior when $fd comes from, e.g., an exec() or file-descriptor pass via UNIX socket, if the $fd comes from an XSUB it’s often counterproductive since the XSUB may well want to use the file descriptor itself.
Currently this can be worked around by retaining a hash of ( $fd => $fh ), but “dangling filehandles” are rather ugly.
REQUEST: Provide a way to tell Perl that a given filehandle’s underlying file descriptor should not be close()d when the filehandle is garbage-collected.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the issue discussion and the shown open() form to understand the requested file-descriptor lifetime behavior and the intended API. Define what should happen when the handle is garbage-collected, then add coverage demonstrating both preserved and normally closed descriptors; the issue is done when the behavior is documented and tested.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- perl
- Domain
- operating-systems
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100