Subject: | load_plugin does not die, nor even return false, if loading plugin did not work |
If loading a plugin fails (e.g. the underlying module is missing some prereqs), load_plugin should return false, so the caller can bail out or take other action.
As an example of how things can go wrong: t/load_plugins.t in the Devel-REPL repository attempts to load all plugins, skipping the test if 'use $class' failed.
Devel::REPL::Plugin::CompletionDriver::Globals builds on top of Devel::REPL::Plugin::Completion, which in turn depends on optional prereqs. When ::Globals calls load_plugin('Completion'), we need to find out at compile time that this failed, so we can also die (at compile time), rather than waiting until the test calls load_plugin('CompletionDriver::Globals') (which causes a failing test).
This is easy to reproduce by running t/load_plugins from the 1.003021 release, without installing any of the optional features.