Skip to content

Commit 4804128

Browse files
committed
[io grant] Document IO::Handle.DESTROY
1 parent 83d5de0 commit 4804128

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

doc/Type/IO/Handle.pod6

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,19 @@ a dangling combiner. However, it also means that when the user inputs just an
4646
"e" and has no intention to also input a combining acute, your program will be
4747
waiting for another keypress before the initial "e" is returned.
4848
49+
=head2 submethod DESTROY
50+
51+
Defined as:
52+
53+
submethod DESTROY(IO::Handle:D:)
54+
55+
Closes the filehandle. Note that garbage collection is not guaranteed to
56+
happen, so you must NOT rely on C<DESTROY> for closing the handles you
57+
I<write to> and instead close them yourself. Programs that open a lot of files
58+
should close the handles explicitly as well, regardless of whether they were
59+
open for writing, since too many files might get opened before garbage
60+
collection happens and the no longer used handles get closed.
61+
4962
=head2 method eof
5063
5164
Returns C<True> if the read operations have exhausted the content of the file.

0 commit comments

Comments
 (0)