Skip to content
This repository


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Custom Filter Issue #7

alnewkirk opened this Issue · 7 comments

2 participants

Al Newkirk ifim
Al Newkirk

custom filters not being executed at all?

Al Newkirk alnewkirk closed this

I'm trying to run the example on filters, but yeah, they don't work at all. I copied the example almost verbatim except the line which uses Validate::Class instead of Validation::Class, there are several instances where the same typo appears in the main documentation.

$ perl -MMyApp::Person -e0
Can't locate object method "filter" via package "Validation::Class::Configuration" at /home/ifim/.perlbrew/libs/perl-5.16.2@validationclass/lib/perl5/Validation/Class/ line 1713.
Compilation failed in require at MyApp/ line 5.
BEGIN failed--compilation aborted at MyApp/ line 5.
Compilation failed in require.
BEGIN failed--compilation aborted.

You should reopen this issue, I may be able to lend a hand.

Al Newkirk

Thanks for the inquiry, which version of V::C are you running?
e.g. perl -MValidation::Class -E 'say $Validation::Class::VERSION'


It returns me an uninitialized value error. The Validation::Class package doesn't hold a $VERSION variable, but Makefile.PL does contain it:

grep -i version Makefile.PL
  "VERSION" => "7.900031",
unless ( eval { ExtUtils::MakeMaker->VERSION(6.56) } ) {
  unless eval { ExtUtils::MakeMaker->VERSION(6.52) };

So far, I've found/changed this:

diff --git a/lib/Validation/Class/ b/lib/Validation/Class/
index 550ddaf..ff9f149 100644
--- a/lib/Validation/Class/
+++ b/lib/Validation/Class/
@@ -1710,7 +1710,7 @@ sub register_filter {

     my ($self, $name, $code) = @_;

-    $self->configuration->filter->add($name, $code);
+    $self->configuration->filters->add($name, $code);

     return $self;

But the custom filters don't seem to affect the fields yet.

Al Newkirk

OH, {o_o}, Sorry about that, I'll fix that right now. Let me know if you find anything else.

Al Newkirk

Releasing fix as part of Validation::Class version 7.900032, releasing now!


It does run smoothly now,

Al Newkirk
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.