diff options
author | Marc Green <marcgreen@cpan.org> | 2012-01-17 00:58:59 -0500 |
---|---|---|
committer | Marc Green <marcgreen@cpan.org> | 2012-01-23 21:33:30 -0500 |
commit | c3a7b12650951e80a0d1b479c65d67e4ef5cf95d (patch) | |
tree | a319a8b0829e665cb0465f80fe9da4ffa7cd51a0 | |
parent | 140672afafbee1a37729e7b95bef30e4f44edd53 (diff) | |
download | perl-c3a7b12650951e80a0d1b479c65d67e4ef5cf95d.tar.gz |
Modernize the use of open() (copied from old code)
-rw-r--r-- | ext/Pod-Html/lib/Pod/Html.pm | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/ext/Pod-Html/lib/Pod/Html.pm b/ext/Pod-Html/lib/Pod/Html.pm index 1816c523ea..3977ded966 100644 --- a/ext/Pod-Html/lib/Pod/Html.pm +++ b/ext/Pod-Html/lib/Pod/Html.pm @@ -558,33 +558,33 @@ sub load_cache { local $_; warn "scanning for directory cache\n" if $Verbose; - open(CACHE, "<$dircache") || + open(my $cachefh, '<', $dircache) || die "$0: error opening $dircache for reading: $!\n"; $/ = "\n"; # is it the same podpath? - $_ = <CACHE>; + $_ = <$cachefh>; chomp($_); $tests++ if (join(":", @$podpath) eq $_); # is it the same podroot? - $_ = <CACHE>; + $_ = <$cachefh>; chomp($_); $tests++ if ($podroot eq $_); # load the cache if its good if ($tests != 2) { - close(CACHE); + close($cachefh); return 0; } warn "loading directory cache\n" if $Verbose; - while (<CACHE>) { + while (<$cachefh>) { /(.*?) (.*)$/; $Pages{$1} = $2; } - close(CACHE); + close($cachefh); return 1; } |