my $custom_validator = sub { if($_[0] =~ /\A(.*)/\z/) { return (1, $1, "Passed"); } else { return (0, undef, "$_[0] is not valid"); } };