Skip to content

Commit 2ca1886

Browse files
committed
Do not explicitly suggest to check for file"s existence before reading
It"s not a suitable check due to race conditions and errors when opening for read aren"t as evil as the current wording suggests
1 parent 94e045f commit 2ca1886

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

doc/Language/io.pod

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,8 @@ of the C<Str> type.
9292
9393
=head1 Checking files and directories
9494
95-
We don't want an error to be thrown if we try to open a file that doesn't
96-
exist. So, how do we know that the file even exists before reading it?
97-
This is what the C<e> method on an C<IO::Handle> object is for.
95+
Use the C<e> method on an C<IO::Handle> object to test whether the file or
96+
directory exist.
9897
9998
if "nonexistent_file".IO.e {
10099
say "file exists";

0 commit comments

Comments
 (0)