Skip Menu |

This queue is for tickets about the Params-Validate CPAN distribution.

Report information
The Basics
Id: 115241
Status: open
Priority: 0/
Queue: Params-Validate

People
Owner: Nobody in particular
Requestors: bitcard [...] siteaboutnothing.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 1.24
Fixed in: (no value)



Subject: Random order of parameters in "Mandatory parameters missing" message
When I get this message: Mandatory parameters 'x', 'y', 'z' missing in call to Foo::bar The order of 'x', 'y', 'z' changes each time I run the code. It would be nice if it was sorted so it could be more easily checked in tests. Using perl 5.22.2, an example: use Params::Validate qw(:all); my @in = (); my %params = validate( @in, { x => { type => SCALAR }, y => { type => SCALAR }, z => { type => SCALAR }, }); Output on different runs: Mandatory parameters 'y', 'x', 'z' missing in call to (unknown) at ./test.pl line 3. Mandatory parameters 'z', 'x', 'y' missing in call to (unknown) at ./test.pl line 3. Mandatory parameters 'x', 'y', 'z' missing in call to (unknown) at ./test.pl line 3.
On Fri Jun 10 11:13:23 2016, random. wrote: Show quoted text
> When I get this message: > > Mandatory parameters 'x', 'y', 'z' missing in call to Foo::bar > > The order of 'x', 'y', 'z' changes each time I run the code. It would > be nice if it was sorted so it could be more easily checked in tests. > > Using perl 5.22.2, an example: > > use Params::Validate qw(:all); > my @in = (); > my %params = validate( @in, { > x => { type => SCALAR }, > y => { type => SCALAR }, > z => { type => SCALAR }, > }); > > Output on different runs: > > Mandatory parameters 'y', 'x', 'z' missing in call to (unknown) > at ./test.pl line 3. > > Mandatory parameters 'z', 'x', 'y' missing in call to (unknown) > at ./test.pl line 3. > > Mandatory parameters 'x', 'y', 'z' missing in call to (unknown) > at ./test.pl line 3.
This is because of the hash randomization changes in recentish Perl versions. Patches are welcome to sort the keys.