On Tue, 24 Jun 2003, Flavio S. Glock wrote:

> Michel Rodriguez wrote:
> > Variable/Parameter conventions can start religious wars, so I would like
> > to offer module authors a way to be a little oecumenical, so they can
> > easily offer named parameters that follow the one_true_perl_convention or
> > even the baddlyNamedCamelCaseConvention.
>
> Param::Validate has some related functionality:
>
>    my %p = validate_with
>                ( params => [EMAIL PROTECTED],
>                  ignore_case   => 1,
>                  strip_leading => '-',
>                );
>
> Maybe adding a "ignore_underline" option to
> Param::Validate would be enough (used with "ignore_case") ?

I looked at Params::Validate, but it seems to me that the goal of the 2
modules is quite different: Params::Validate does not update the original
hash, which is Params::Normalize primary goal. I like the fact that no
matter what convention the user code uses I can get the options as perl
style in my code, and if needed pass them to a lower-level module that
uses the java style (XML modules seem to like it).

Params::Check is the closest I have found, as it lets you validate params
but also converts all the keys in the hash to lower case (it might be
worth adding such an option to Params::Validate).

Michel Rodriguez
Perl & XML
http://www.xmltwig.com


Reply via email to