Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re^2: Params::Validate or Attribute::Params::Validate?

by diotalevi (Canon)
on Oct 19, 2005 at 19:22 UTC ( #501386=note: print w/ replies, xml ) Need Help??


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

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 }' ); } }


Comment on Re^2: Params::Validate or Attribute::Params::Validate?
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (14)
As of 2015-07-31 14:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (278 votes), past polls