Subject: | typos in Pod |
Dave,
I'm becoming a big fan of your modules and your writing style.
Params::Validate for one.
On a close reading I found some typos in the Pod:
Specifying defaults
If the "validate()" or "validate_pos()" functions are called in a list
context, they will return an array or hash containing the original
parameters plus defaults as indicated by the validation spec.
This should read 'will return a hash or array' rather than 'an array or hash', yes?
validate() returns hash, validate_pos() returns array.
Further down in the same section:
Simple examples of defaults would be:
my %p = validate( @_, { foo => 1, bar => { default => 99 } } );
my @p = validate( @_, 1, { default => 99 } );
The last should be a call to validate_pos(), yes?
"GLOBAL" OPTIONS
Because the API for the "validate()" and "validate_pos()" functions
does not make it possible to specify any options other than the the
validation spec, it is possible to set some options as
pseudo−’globals’.
You have a doubled 'the' at the end of the second line.
In the description of the 'normalize_keys' callback you use
validation_with() rather than validation_options(). You have not
yet introduced validation_with() so it is probably clearer to
have the example use validation_options() [ there is NO example of its use ].
One cannot call validation_options (or validate_with)
with a hashref as one would expect:
validation_options({
normalize_keys => sub { ... },
allow_extra => 0,
});
In describing 'normalize_keys':
If a callback is given than the deprecated "ignore_case" and
"strip_leading" options are ignored.
'than' should be 'then'.
As an aside - in implementing validate_with() it was
rather clever of you to use the type of reference (hash or array)
given to 'spec' to determine whether to do validate or validate_pos.
As a Perl hacker (not a wizard like yourself) I'm glad to provide
a little proofreading for you.
Jon