Class::Accessor talking to Params::Validate

cwest on 2003-09-23T14:37:16

I wonder if anyone else would find this useful.

__PACKAGE__->accessor_validation(
    name => {
             validate => 'pos',
             spec     => [
                           { type => SCALAR },
                         ],
            },
    .... => { ... },
);
__PACKAGE__->mk_accessors( qw[name ... ] );
I also can't think of a good name to call it. Any ideas? For now I'm just using it in a project with a project specific package name. One suggestion was Class::Validate, but that removes the accessor bit. Class::Accesssor::Validate removes the params bit, but might be better.

Posted from caseywest.com, comment here.