CC: | DAGOLDEN [...] cpan.org |
Subject: | Minor robustness suggestion |
In IP/Country/Fast.pm I find the line 32:
(my $module_dir = $INC{'IP/Country/Fast.pm'}) =~ s/\.pm$//;
This usually works and there's nothing wrong with the code except for
one case: when somebody executes the code outside a require. (See below
for why would somebody do that). Fortunately perl has a slightly more
robust construct that would help in such cases:
(my $module_dir = __FILE__) =~ s/\.pm$//;
and it's shorter too. All tests pass after the replacement.
So why would somebody execute a pm outside a require?
CPAN::Reporter::PrereqCheck does it when it tries to determine whether
all prerequisites were actually working during test execution. The
effect of this is that all dependents of IP::Country::Fast get no fail
reports because CPAN::Reporter determines that the dependency already
failed, so the test result is bogus. (CC'd to DAGOLDEN)
I've rated this ticket as 'Unimportant' because it is nothing wrong in
your code, just an interesting special case that we are not seeing every
day.
Kind Regards,