summaryrefslogtreecommitdiff
path: root/pod/perlsub.pod
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@gmail.com>2007-07-10 06:17:50 +0000
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2007-07-10 06:17:50 +0000
commit7b815c6704d8d91c01d55658479cef13e65d2733 (patch)
treea34232d4aedcd8a9114b0d45db743c9811c37827 /pod/perlsub.pod
parent1694bc1323f3c2ea90d7478c304c5f10b28e69f3 (diff)
downloadperl-7b815c6704d8d91c01d55658479cef13e65d2733.tar.gz
Modernize opendir() syntax
p4raw-id: //depot/perl@31576
Diffstat (limited to 'pod/perlsub.pod')
-rw-r--r--pod/perlsub.pod7
1 files changed, 3 insertions, 4 deletions
diff --git a/pod/perlsub.pod b/pod/perlsub.pod
index a04dfc95c4..fed1474a03 100644
--- a/pod/perlsub.pod
+++ b/pod/perlsub.pod
@@ -1302,10 +1302,9 @@ that understands regular expressions.
sub glob {
my $pat = shift;
my @got;
- local *D;
- if (opendir D, '.') {
- @got = grep /$pat/, readdir D;
- closedir D;
+ if (opendir my $d, '.') {
+ @got = grep /$pat/, readdir $d;
+ closedir $d;
}
return @got;
}