X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=current%2Flib%2FHTML%2FCalendarMonth%2FDateTool.pm;h=0e752a3d5f9456c87045ba94b1f95d73ba68cf2a;hb=982e2bb08f00d800e2cd9fb65b108231719c8a65;hp=91df572ca0e895746e7c6eecdc9446c694260a19;hpb=2a7fc55a2e563096c7348a2f6272a16830561513;p=deb_pkgs%2Flibhtml-calendarmonth-perl.git diff --git a/current/lib/HTML/CalendarMonth/DateTool.pm b/current/lib/HTML/CalendarMonth/DateTool.pm index 91df572..0e752a3 100644 --- a/current/lib/HTML/CalendarMonth/DateTool.pm +++ b/current/lib/HTML/CalendarMonth/DateTool.pm @@ -1,6 +1,6 @@ package HTML::CalendarMonth::DateTool; -BEGIN { - $HTML::CalendarMonth::DateTool::VERSION = '1.25'; +{ + $HTML::CalendarMonth::DateTool::VERSION = '1.26'; } # Base class for determining what date calculation package to use. @@ -210,6 +210,8 @@ sub _summon_date_class { my $self = shift; my @tools; if (my $c = $self->datetool) { + eval "use $c"; + die "invalid date tool $c : $@" if $@; @tools = $c->_name; } else { @@ -228,7 +230,7 @@ sub _summon_date_class { } return $dc if $dc; if (@tools == 1) { - croak "invalid date tool " . join(': ', @{$fails[0]}) if @tools == 1; + croak "invalid date tool " . join(': ', @{$fails[0]}); } else { croak join("\n", @@ -301,6 +303,8 @@ sub _datemanip_fails { return "not installed" unless $self->_datemanip_present; return "historic mode prior to 1752/09 not supported" if $self->historic && $self->_is_julian; + eval { require Date::Manip && Date::Manip::Date_Init() }; + return "init failure: $@" if $@; return; } @@ -311,6 +315,7 @@ sub _datemanip_present { eval "require Date::Manip"; return !$@ } sub _ncal_present { shift->_ncal_cmd } sub _cal_present { shift->_cal_cmd }; + 1; __END__