If there is no XML::Simple to be found, and parse is asked to look at an
XML File, it croaks with an unhelpful error message:
Can't use string ("") as a subroutine ref while "strict refs" in use at
//ms/dist/perl5/PROJ/Config-Auto/0.12/lib/perl5/Config/Auto.pm line 74
The score subroutine scores 'xml' as the best (and only option). The parse
function then blindly dispatches the method in the method hash. But if
XML::Simple failed to load, the 'xml' method is rudely removed from the
method table.
So please die if XML::Simple cannot be loaded, or die if xml scores and
we haven't loaded it into %INC, or don't dispatch the method blindly,
instead do something like this on line 74:
return $methods{$method}->($file) if exists $methods{$method};
return;
or any of a myriad other ways that don't obfuscate the underlying problem.
Thanks!