Strangely, I'm replying to myself:

The answer to my question is yes, one must write a custom constraint. I got this reply from the module author (Mark Stosberg):

Fred, if using the 'dependencies' system doesn't solve your problem, I think you are right. You could write a custom constraint for b or c, such that they only kick-in if A is present.

He also suggested that I propose any new functionality to the maintainers list.

Solving my problem I used the following code (see Data::FormValidator for explaination)

# .. snip # Part of my hash to pass to D::FV constraints => { dn_id => 'OK_int', b => { constraint => 'custom_constraint_sub_name', params => [ qw/ b a / ], }, c => { constraint => 'custom_constraint_sub_name', params => [ qw/ c a / ], }, } # .. snip ... # Defining my constraint routine elsewhere: ################################# sub match_custom_constraint_sub_name { my $val = shift; my $a = shift; if ( $a eq 'N' ) { return match_another_custom_constraint($val) ; } else { return "0"; # use this default value }

-------------------------------------
Nothing is too wonderful to be true
-- Michael Faraday


In reply to Re: Data::FormValidator question by freddo411
in thread Data::FormValidator question by freddo411

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.