Too many my $fh:s.
[p5sagit/p5-mst-13.2.git] / lib / CPAN.pm
index 81b335b..0afcef5 100644 (file)
@@ -3666,6 +3666,17 @@ sub dir_listing {
     my $lc_want =
        File::Spec->catfile($CPAN::Config->{keep_source_where},
                            "authors", "id", @$chksumfile);
+
+
+    my $fh;
+
+    # purge and refetch old (pre-PGP) CHECKSUMS; they are a security hazard
+    $fh = FileHandle->new;
+    if (open($fh, $lc_want)){
+       my $line = <$fh>; close $fh;
+       unlink($lc_want) unless $line =~ /PGP/;
+    }
+
     local($") = "/";
     # connect "force" argument with "index_expire".
     my $force = 0;
@@ -3688,7 +3699,7 @@ sub dir_listing {
     }
 
     # adapted from CPAN::Distribution::MD5_check_file ;
-    my $fh = FileHandle->new;
+    $fh = FileHandle->new;
     my($cksum);
     if (open $fh, $lc_file){
        local($/);