Subject: | Incorrect usage of UNIVERSAL::require |
FormValidator::Simple is using UNIVERSAL::require incorrectly. This
script illustrates...
#!/usr/bin/perl -w
use FormValidator::Simple;
for(1..2) {
$@ = "foo";
print "Iteration $_\n";
FormValidator::Simple->load_plugin("FormValidator::Simple::Plugin::DBIC::Unique");
}
Assuming the plugin is installed, you can pick any plugin, it will fail
on the second iteration with UNIVERSAL::require 0.11. This is due to
this code:
41 $plugin->require;
42 if ($@) {
43 FormValidator::Simple::Exception->throw(
44 qq/Couldn't require "$plugin", "$@"./
45 );
46 }
UNIVERSAL::require 0.11 does not always call eval, so if something else
set $@ the above will fail.
Instead, check the return code of require directly.
unless( $plugin->require ) {
...
}