changes since 0.59:
0.72 Dec 3, 2003
- If a normalize_keys callback returns the same normalized key for two
different inputs, Params::Validate will die.
- The pure Perl implementation had a bug where if the same hash
reference was used for the spec in multiple calls to validate(), then
any call made after a parameter failed a validation check could
exhibit strange behaviors (like parameters passing that shouldn't,
etc.). This was due to the fact that the Perl implementation uses
each() internally, and was leaving the hash's iterator partially
iterated. Reported via an apparent problem with DateTime.pm by Jost
Krieger.
0.71 Dec 2, 2003
- Suppressed some annoying "subroutine redefined" warnings if the pure
Perl version ended up being loaded after attempting to load the XS
version.
0.70 Nov 23, 2003
- Any validation call that used a callback leaked memory when using
the XS version. This was introduced in 0.67, when callbacks started
receiving a reference to the parameters as a second argument.
Reported by Eugene van der Pijll.
0.69 Nov 3, 2003
- The key normalization feature introduced in 0.66 leaked one SV*
every time a parameter _hash_ was run through the XS version of
validate() or validate_with(). This happened if one of
normalize_keys, allow_extra, or ignore_case was set, or if
validate_with() was used. Upgrading is strongly recommended!
Reported by Ruslan.
0.68 Oct 21, 2003
- Added spiffy new parameter dependency feature. Implemented by
Daisuke Maki.
0.67 Oct 10, 2003
- The test count for 06-option.t was off. Reported by Christian
Schaffner.
- Validation callbacks now receive a reference to the (normalized)
parameter hash/array as their second argument.
- Shut up an "unitialized value in subroutine entry" warning caused by
calling validate_pos() with an undef value in the parameter array.
This was introduced in 0.66.
0.66 Oct 08, 2003
- Skip a few more tests under Perl 5.6.0. Patch from Christian
Schaffner.
- Error messages now include the stringified value of the variable
that was invalid. Implemented by Daisuke Maki.
- Added a new parameter normalization callback feature, the
"normalize_keys" option. Implemented by Daisuke Maki.
** The "strip_leading" and "ignore_case" options are now deprecated.
Use the new "normalize" feature instead.
0.65 Aug 07, 2003
- It is now possible to turn validation on and off at runtime. To
make this easier, it can be set via the PERL_NO_VALIDATION environment
variable, or the $Params::Validate::NO_VALIDATION global variable. Go
ahead, shoot yourself in the foot with it!
0.64 Jul 14, 2003
- Fix an XS compilation error under 5.6.1:
Validate.xs: In function `validate_isa':
Validate.xs:381: `perl_on_error' undeclared (first use in this function)
0.63 Jul 14, 2003
- The XS version of validate_with failed if the params key contained
an array reference containing a single hash reference. Since this
works with the pure Perl version, it should work with the XS version.
Reported by Diab Jerius. Bug #2791 on rt.cpan.org.
0.62 Jun 25, 2003
- Remove a warn() statement left in from debugging. Reported by Shane
McCarron.
0.61 Jun 23, 2003
- The last release had some debugging code left in which tried to load
Devel::StackTrace. Reported by Iain Truskett.
0.60 Jun 21, 2003
- Fixed a weird segfault that could occur with Perl 5.6.1 when a
user-defined on_fail callback died with an object as its argument.
This only happened with the XS version of the code. Reported by Ken
Williams.
The end result is that the version of the XS code that is used with
Perl 5.6.0 and 5.6.1 is slightly slower than that used with 5.00503 or
5.8.0, as it requires an additional Perl-level wrapper.
- Use XSLoader in preference to Dynaloader with Perl 5.6.0+.
Changes:
- If an odd number of parameters was given to validate() in the array
as its first argument, the error given would be different depending on
whether or not the pure Perl or XS version of the code was being used.
- Fixed incredibly odd bug that occurred in XS code when tainting was
on with Perl 5.00503. Unfortunately, the only test case that reliably
reproduces this is one of Mason's tests, so no test was added.
- Fix some compiler warnings from MS Visual Studio 6. Reported by Ron
Hill.
- When called from the main body of a script, the validation routines
would cause an undefined value warning if validation failed. Reported
by Britton Kerin and fixed by Ilya Martynov.
- The XS code that handled callbacks expects all callbacks to return
an integer, instead of simply testing the returned value for truth.
This could cause strange warnings like 'Argument "InMemory" isn't
numeric in subroutine entry...'. Based on a bug report from Robert
Dick for another module I wrote (Lingua::ZH::CCDICT).
- Fixed Params::Validate for Perl configurations where sizeof(IV) !=
sizeof(int). Reported by Alain Barbet.
- Something around test 5 in 06-options.t appear to cause Perl to
die/segfault/something under 5.6.0. These tests will be skipped with
5.6.0 in the future. Reported by Christian Schaffner.
- When testing for a compiler, use nmake on Win32. Implemented by
Ronald Hill.
- Added regex validation option.
- Added copyright info to each source file. Added LICENSE file to
distro.
- Added an XS implementation, written by Ilya Martynov. The pure Perl
implementation is still included as a fallback for users who do not
have a compiler handy. The XS implementation gives a speed boost of
150% to 300%, depending on the complexity of the validation being
done.
This XS code is known to work Perl 5.00503+, but it may not work with
earlier versions of Perl.
- Fix Attribute::Params::Validate docs to show that attribute
declaration must have open paren immediately after "Validate" or
"ValidatePos". Reported by Britton Kerin.
- Fix bug with Perl 5.8.0 when in PERL_NO_VALIDATION mode and calling
validate() expecting a hash ref to be returned. Reported by Randal
Schwartz.
- Argh. In 0.22 some of the tests printed their test counts (1..x)
after doing the tests. This works with newer versions of
Test::Harness so I didn't notice it. Reported by Peter Asemann.
- The last version's tarball was a mess, and had blib and other junk
in it. This is a nice clean one.
- The various validation functions are now context sensitive, and will
return a reference in scalar context. This may be a helpful speedup,
especially for large parameter lists.
- More optimization work.
-- Improved the speed of both validate() and validate_pos() by about
20-25%.
-- Improved the speed of the 'no validation' mode for validate() by
over 30%, for validation_pos() by 15%, and for validate_with() by
125%.
-- The speed of validate_with() has been improved by over 100%, but
this was at the expense of not validating its own incoming arguments,
thus making it a little more fragile.
- The PERL_NO_VALIDATION env var is now _only_ checked when the module
is loaded. This means you cannot change it mid-program. This is a
backwards incompatibility.
- Added a new function, validate_with(), that allow you to set various
options on a per-invocation basis, rather than on a per-package basis.
Patch by Ken Williams.
- Fix a doc nit where I had a wrong code example. Reported by Britton
Kerin.
- Added a new validation option parameter, stack_skip, which allows
you to change how errors are reported by Params::Validate.
- Improve skipping of tests when run with 5.6.0. Patch by Ken
Williams.
- Silence an uninit value warning
- validate_pos used exists on an array element, which only works with
5.6.0. This releaes makes it work 5.00503 again.
- the validation parameters are checked first now
- performance improved on named parameters
- add BOOLEAN type (equivalent to UNDEF | SCALAR)
- fixed buges in test
- apply some of the same optimizations to positional parameters
- The 'NO_VALIDATION' mode was seriously broken in that it didn't
handle defaults at all.
- The 'NO_VALIDATION' env var was mis-documented as being
'NO_VALIDATE'.
- The 'NO_VALIDATION' env var is now 'PERL_NO_VALIDATION' and this
method of disabling validation is no longer considered alpha.
- The validation functions now check this environment variable every
time they are called.
- Fix problem with CPAN shell's 'r' command that
Attribute::Params::Validate was causing with older Perl's.
- Add ability to specify defaults for parameters and get a new
hash/array back from validate or validate_pos.
- Require Attribute::Handlers if using Perl 5.6.0+.
- fix doc nits.
- Added Attribute::Params::Validate - do validation via attributes
- Rename set_options to validation_options. This can now be exported
safely and is included in the :all export tag. set_options is
deprecated and will be removed in a future release.
Also fixes PR/15225 by Shell Hung.
The automatic truncation in gensolpkg doesn't work for packages which
have the same package name for the first 5-6 chars.
e.g. amanda-server and amanda-client would be named amanda and amanda.
Now, we add a SVR4_PKGNAME and use amacl for amanda-client and amase for
amanda-server.
All svr4 packages also have a vendor tag, so we have to reserve some chars
for this tag, which is normaly 3 or 4 chars. Thats why we can only use 6
or 5 chars for SVR4_PKGNAME. I used 5 for all the packages, to give the
vendor tag enough room.
All p5-* packages and a few other packages have now a SVR4_PKGNAME.
The Params::Validate module provides a flexible system for validation
method/function call parameters. The validation can be as simple as
checking for the presence of required parameters or as complex as
validating object classes (via isa) or capabilities (via can),
checking parameter types, and using customized callbacks to ensure
data integrity.