Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?

Re: Config::Validate: problem with a key type

by spazm (Monk)
on Mar 22, 2010 at 17:02 UTC ( #830114=note: print w/replies, xml ) Need Help??

in reply to Config::Validate: problem with a key type

Quoting the perldoc:

The string type does no validation if no addition restrictions are specified. Valid options are:

* min
Minimum length
* max
Maximum length
* regex
String must match the regex provided.
  • Comment on Re: Config::Validate: problem with a key type

Replies are listed 'Best First'.
Re^2: Config::Validate: problem with a key type
by Hue-Bond (Priest) on Mar 22, 2010 at 18:05 UTC

    Adding those additional restrictions has no effect. This is my current $schema:

    my $schema = { section => { type => 'nested', child => { key => { type => 'string', regex => qr/^ ARRAY \( 0x\p{HexDigit}{1,8} \) $/x, }, }, }, };

    The code still runs to completion. If I make the regex different (e.g. by changing "ARRAY" into "ARAY"), the code complains about the data not matching the schema. Looks like a bug to me...

    Thank you for giving me the clue!

     David Serrano
     (Please treat my english text just like Perl code, i.e. feel free to notify me of any syntax, grammar, style and/or spelling error. Thank you!).

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://830114]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (3)
As of 2018-01-18 04:43 GMT
Find Nodes?
    Voting Booth?
    How did you see in the new year?

    Results (206 votes). Check out past polls.