Skip to content

Commit

Permalink
Merge 7683e28 into aa467bd
Browse files Browse the repository at this point in the history
  • Loading branch information
Corion committed May 21, 2021
2 parents aa467bd + 7683e28 commit d0f2994
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pod/perlfunc.pod
Expand Up @@ -6333,6 +6333,8 @@ value, not for its regular truth value.
while (readdir $dh) {
print "$some_dir/$_\n";
}
die "Got error while reading '$some_dir': $!"
if $!;
closedir $dh;

To avoid confusing would-be users of your code who are running earlier
Expand All @@ -6342,6 +6344,8 @@ recent vintage:

use 5.012; # so readdir assigns to $_ in a lone while test

In the case of an error, C<undef> will be returned and $! will be non-zero.

=item readline EXPR

=item readline
Expand Down
1 change: 1 addition & 0 deletions pp_sys.c
Expand Up @@ -4027,6 +4027,7 @@ PP(pp_readdir)
}

do {
SETERRNO(0,0);
dp = (Direntry_t *)PerlDir_read(IoDIRP(io));
if (!dp)
break;
Expand Down

0 comments on commit d0f2994

Please sign in to comment.