http://www.perlmonks.org?node_id=359256

Junk

#!/usr/bin/perl use strict; use warnings; use CPAN::Mirrors; use LWP::UserAgent; use Digest::SHA qw(sha256_hex); my $sha256 = '8e3fccbf4c7e87c2df7c1e756fc17666a708bab8b36fd2004163756 +51d9b86e1'; my $path = 'authors/id/R/RS/RSCHUPP/PAR-Packer-1.047.tar.gz'; my $mirrors = CPAN::Mirrors->new( 'MIRRORED.BY' ); my @mirrors = $mirrors->mirrors(); my ( @goodsha, @badsha, @problemmirror ); my $ua = LWP::UserAgent->new(); $ua->max_redirect( 6 ); foreach my $cpan ( @mirrors ){ if ( $cpan->{http} ){ print "Checking Mirror: $cpan->{http}\n"; my $url = $cpan->{http} . $path; my $res = $ua->get( $url ); if ( $res->is_success ){ my $file = $res->decoded_content( charset => 'none' ); my $file_sha = sha256_hex( $file ); if ( $file_sha eq $sha256 ){ print "Matching SHA\n"; push @goodsha, $url; }else{ print "Warning: SHA does not match!\n"; print "Got : $file_sha\nExpected: $sha256\n"; push @badsha, $url; } }else{ print "Couldn't download $url\n"; push @problemmirror, $url; } } } print "'Bad' mirrorsn\n\n" . join( "\n", @badsha ) if ( @badsha ); print "\n'Unreachable' mirrors\n\n" . join( "\n", @problemmirror ) if +( @problemmirror );

Replacement Makefile.PL for File::Repl.

# File::Repl # # Version # $Source: d:/src/perl/File/Repl/RCS/Makefile.PL $ # $Revision: 1.4 $ # $State: Exp $ # # Start comments/code here - will not be processed into manual pages # # Copyright - Dave Roberts 2000,2001 # # Revision history: # $Log: Makefile.PL $ # Revision 1.4 2011/11/25 07:29:24 Dave.Roberts # added COMPRESS arguments # # Revision 1.3 2001/06/27 12:33:57 jj768 # Changes to ignore the RCS directory # # #********************************************************************* +********* use strict; use warnings; use ExtUtils::MakeMaker; my %WriteMakefileArgs = ( 'NAME' => 'File::Repl', 'VERSION_FROM' => 'Repl.pm', 'PREREQ_PM' => { 'File::Find' => 0, 'File::HomeDir' => 0, 'File::Copy' => '2.03', 'File::Basename' => '2.6' }, 'dist' => { ZIP => 'wzzip.exe', ZIPFLAGS => '-P', COMPRESS => 'gzip --best --force', }, 'MAN3PODS' => { 'Repl.pm' => 'blib/man3/File::Repl.3', }, 'PM' => { 'Repl.pm' => '$(INST_LIBDIR)/Repl.pm', } ); if ( ( $^O eq 'MSWin32' ) or ( $^O eq 'cygwin' ) ) { $WriteMakefileArgs{PREREQ_PM}{'Win32::API'} = '0'; } WriteMakefile(%WriteMakefileArgs); package MY; sub postamble { <<"END_OF_POSTAMBLE"; pm_to_blib: README README: Repl.pm \tpod2text Repl.pm >README \tpod2html Repl.pm >Repl.html END_OF_POSTAMBLE } # Just to make it ignore editor backup files. sub libscan { $_ = $_[1]; if ( m/(RCS|CVS|SCCS)/i || m/[~%]$/ || m/\.(orig|rej)$/ ) { print " Ignoring $_\n"; return ''; } return $_; }