Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?

Re: Params::Validate or Attribute::Params::Validate?

by xdg (Monsignor)
on Oct 18, 2005 at 11:54 UTC ( #500943=note: print w/replies, xml ) Need Help??

in reply to Params::Validate or Attribute::Params::Validate?

Attribute::Params::Validate uses Attribute::Handlers. While I haven't testing this out, I suspect it breaks in any module that defines its own attribute handlers instead of using Attribute::Handlers. For example, Class::Std (see Class::Std : How does MODIFY_HASH_ATTRIBUTES work? -- in addition to lack of thread safety, yet another reason to be careful using it).

Params::Validate works just fine. I also find it useful to be able to define some default specs in one place and use it many times. With the attribute version, you always have to put the spec in the attribute line.


Code written by xdg and posted on PerlMonks is public domain. It is provided as is with no warranties, express or implied, of any kind. Posted code may not have been tested. Use of posted code is at your own risk.

  • Comment on Re: Params::Validate or Attribute::Params::Validate?

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://500943]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (9)
As of 2016-10-28 19:03 GMT
Find Nodes?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?

    Results (386 votes). Check out past polls.