9

It is hard for me to choose between two perl modules - Params::Validate and Params::Check. I am writing a Mojolicious application which should be easily distributable. Generally I mean something like uploading a directory structure on a shared hosting and be ready to run. Params::Validate is quite powerfull and tought, has Pure-Perl implementation. Params::Check is in the Perl Core distribution since version 5.10.0 Can you point other "why should I prefer the one or the other"?

Беров
  • 1,383
  • 10
  • 22
  • 1
    I will mention Method::Signatures which now has type/class/role validation, is far less verbose, but has a dependency chain. http://search.cpan.org/~mschwern/Method-Signatures-20110324.1600_001/lib/Method/Signatures.pm – Schwern Apr 04 '11 at 04:29

3 Answers3

9

Looking through the CPAN bug reports for each of these modules might help you to choose. Currently, Params::Check has no bug reports (it only has one wishlist item), but Params::Validate has a few. Check to see if any bug is relevant to your application.

You could also look at the CPAN Testers platform/version matrix to see if there are any fails on platforms that you would be running on.

toolic
  • 57,801
  • 17
  • 75
  • 117
  • 2
    Thanks. I took another approach... at least for now. Since it is a Mojolicious app and I already use Mojox::Validator, I decided to try Mojox::Validator for some of my routines too(not only for form validation). It has not a common function like "check" or "validate" but I made my own. – Беров Apr 01 '11 at 19:14
1

Using the Mojo validator probably makes sense. I just want to point out that the author of Params::Validate has shifted towards Params::ValidationCompiler

oalders
  • 5,239
  • 2
  • 23
  • 34
0

For now you can use Mojolicious::Validator for validation parameters in Mojo application. http://mojolicio.us/perldoc/Mojolicious/Guides/Rendering#Form-validation

Andrey Khozov
  • 311
  • 1
  • 5