Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

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

by rinceWind (Monsignor)
on Oct 18, 2005 at 16:16 UTC ( #501051=note: print w/ replies, xml ) Need Help??


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

Note that Attribute::Params::Validate ships with Params::Validate.

So far, I've never needed to use the handlers form; Params::Validate has been perfectly adequate for my needs. However, I've found that not everybody likes Params::Validate, and I've had cases of people choosing not to use my CPAN modules owing to dependency on P::V. This inspired me to come up with Module::Optional including Params::Validate::Dummy, which allows people to still use code with calls to validate(), validate_pos() etc. without installing P::V.

Not all of my CPAN modules that use Params::Validate have been changed to use Module::Optionsl yet, but this is something I intend to incorporate on their next release.

--

Oh Lord, won’t you burn me a Knoppix CD ?
My friends all rate Windows, I must disagree.
Your powers of persuasion will set them all free,
So oh Lord, won’t you burn me a Knoppix CD ?
(Missquoting Janis Joplin)


Comment on Re: Params::Validate or Attribute::Params::Validate?
Re^2: Params::Validate or Attribute::Params::Validate?
by Zed_Lopez (Chaplain) on Oct 19, 2005 at 18:52 UTC

    I'm curious -- do you know why some people are so averse to Params::Validate as to avoid modules that depend on it? Do they think it doesn't work, or is cripplingly slow? Do they just avoid all XS?

    It doesn't use source filters or have exotic dependencies; reviews on CPAN ratings are good; there's nothing damning in rt.cpan.org; one Perlmonks node is the only bad I can find about it.

Re^2: Params::Validate or Attribute::Params::Validate?
by diotalevi (Canon) on Oct 19, 2005 at 19:22 UTC

    In Regexp::NamedCaptures, I wrote this snippet so that P::V would be used if it was available and dummied up into place if it wasn't. I have half a mind to make that become a P::V::Fake and just include that with the distribution tarballs of my modules. My Build.PL recommends P::V and my Makefile.PL is silent on the matter.

    BEGIN { eval { require Params::Validate; Params::Validate->import( 'validate_pos', 'SCALAR', 'UNDEF', 'CODEREF' ); }; if ( $@ ) { eval( 'sub validate_pos (\@@) { @{$_[0]} }' . 'sub SCALAR () { 0 }' . 'sub UNDEF () { 0 }' . 'sub CODEREF () { 0 }' ); } }

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (7)
As of 2014-07-13 11:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When choosing user names for websites, I prefer to use:








    Results (249 votes), past polls