Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

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

by xdg (Monsignor)
on Oct 18, 2005 at 11:54 UTC ( [id://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.

-xdg

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?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (1)
As of 2024-04-25 01:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found