Skip Menu |

This queue is for tickets about the FormValidator-Simple CPAN distribution.

Report information
The Basics
Id: 38619
Status: new
Priority: 0/
Queue: FormValidator-Simple

People
Owner: Nobody in particular
Requestors: mschwern [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: (no value)
Fixed in: (no value)



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 ) { ... }