Fix building on a brand new system

Require modules rather than use to prevent Build.PL dying before prereq's can be checked
This commit is contained in:
Duncan Ferguson 2014-11-18 21:01:01 +00:00
parent c4211a1ee5
commit 3cfb83c0d6

View file

@ -7,7 +7,11 @@ use Module::Build;
my $class = Module::Build->subclass(
class => "Module::Build::Custom",
code => q{
use File::Slurp;
# don't check for errors; 'build_requires' should get this sorted
eval {
require File::Slurp;
require CPAN::Changes;
};
sub ACTION_email {
my ($self, @args) = @_;
@ -18,7 +22,6 @@ my $class = Module::Build->subclass(
print "Use '--changes <N>' to define how many to output. Default: 1", $/;
my $change_count = $self->args('changes') || 1;
use CPAN::Changes;
my @changes = CPAN::Changes->load( 'Changes' )->releases;
if($changes[-1]->date =~ m/^0000/) {