Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

use CLass::Load instead of UNIVERSAL::require

  • Loading branch information...
commit 64146c364c5d9f3fc8d6f63a024020b4d70402be 1 parent 9f4d370
@tokuhirom authored
Showing with 4 additions and 4 deletions.
  1. +1 −1  Build.PL
  2. +3 −3 lib/FormValidator/Lite.pm
View
2  Build.PL
@@ -17,7 +17,7 @@ my $build = Module::Build->new(
'perl' => '5.008001',
'Scalar::Util' => '1.19',
'Filter::Util::Call' => '0',
- 'UNIVERSAL::require' => '0.11',
+ 'Class::Load' => '0.11',
'Class::Accessor::Lite' => '0.05',
'CGI' => '3.31'
},
View
6 lib/FormValidator/Lite.pm
@@ -3,13 +3,13 @@ use strict;
use warnings;
use 5.008_001;
use Carp ();
-use UNIVERSAL::require;
use Scalar::Util qw/blessed/;
use FormValidator::Lite::Constraint::Default;
use FormValidator::Lite::Upload;
use Class::Accessor::Lite 0.05 (
rw => [qw/query/]
);
+use Class::Load ();
our $VERSION = '0.28';
@@ -101,14 +101,14 @@ sub load_constraints {
for (@_) {
my $constraint = $_;
$constraint = ($constraint =~ s/^\+//) ? $constraint : "FormValidator::Lite::Constraint::${constraint}";
- $constraint->use or die $@;
+ Class::Load::load_class($constraint);
}
}
sub load_function_message {
my ($self, $lang) = @_;
my $pkg = "FormValidator::Lite::Messages::$lang";
- $pkg->require or die $@;
+ Class::Load::load_class($pkg);
no strict 'refs';
$self->{_msg}->{function} = ${"${pkg}::MESSAGES"};
Please sign in to comment.
Something went wrong with that request. Please try again.