Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?

Re: Re: validating function input

by talkasab (Acolyte)
on May 22, 2003 at 15:42 UTC ( #260115=note: print w/replies, xml ) Need Help??

in reply to Re: validating function input
in thread validating function input

I rate the Params::Validate module very highly. (Thank you, Dave Rolsky.)

I've been using Params::Validate for a couple of months now, for a large project we're working on, and I've found it to be outstanding. Some things we like about it:

  • The interface is reasonably easy to understand, and the power it gives is very flexible.
  • It verifies all kinds of things: types (isa), interfaces (can), array refs, hash refs, regular expressions (use it with Regexp::Common!).
  • In addition, you can write your own validators.
  • In addition, you can turn it off (that is, turn the validation into a no-op) in production code, if you don't like the performance penalty.
  • The documentation is quite clear.
  • We've found that the validate(@_, ...) statements at the top of our functions form a very useful kind of API documentation. (I've been thinking about a way to automatically turn these statements into POD for documenting APIs.)

It might be overkill depending on your application, but if you have a group of developers working together on something, it provides very a clear consistent way to enforce your expectations for a function's inputs.

Replies are listed 'Best First'.
Re: Re: Re: validating function input
by autarch (Hermit) on May 22, 2003 at 17:16 UTC

    I rate the Params::Validate module very highly. (Thank you, Dave Rolsky.)

    You're welcome ;)

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (1)
As of 2022-07-02 02:51 GMT
Find Nodes?
    Voting Booth?
    My most frequent journeys are powered by:

    Results (102 votes). Check out past polls.