Subject: | 'hash' validation assumes values are hashes |
I'm trying to validate a hash which looks like this:
par => { a => 1, b => 2, c => 3 };
The number of entries may vary; I don't care what the names are, as long
as they are strings, and I want to verify that the values are integers.
I thought this might work:
{ par => { type => 'hash', keytype => 'string', child => { type => 'int'
} } }
but instead I get an error of
Can't use string ("1") as a HASH ref while "strict refs" in use.
_validate_hash calls _validate with $cfg = $par{a}, and _validate
assumes it's getting a hashref.
Is there any way of getting this sort of validation? From my perusal of
the code it doesn't look possible.