Subject: | CPAN::Meta::Requirements should handle bad versions more gracefully |
C::M::R::_version_object calls version->parse, which could croak.
This means we can't use C::M::R for cleaning up bad string hash parsing
in C::M::Converter. However, it would suck to duplicate all the parsing
logic in C::M::C.
Idea: add a "bad_version_hook" attribute so we can do something like this:
$r = CPAN::Meta::Requirements->new( { bad_version_hook => \&my_cleaner
} );
Then have _version_object wrap version->parse in an eval and hand off to
the bad_version_hook, if one exists.
That would make it easy for C::M::C to use C::M::R and just inject it's
own cleaning logic (which might be "assume 0" or might be something
smarter depending on what exact prereqs phase/type is being converted).