Thank you for your comments. I have improved the variable names. I have a bad habit of using very short variable names for small functions and things that won't be used very long.

However, I felt that your suggestions for default values would lead to unexpected results (that would also be difficult to understand) in the form of a valid query input that would give results that were obviously not what was intended.

Also, setting the default for maxage would remove the ability for users to provide just one age and get valid results (by having the function copy the minimum to the maximum).

I also decided, based on this thinking, to die instead of returning undef, because if the user is calling this function without parameters, how can we trust them to check for an undef return before passing it into the query? ;)

Thank you for your help in improving this function.


In reply to Re^2: Get DoB Bounds from Age Range by over2sd
in thread Get DoB Bounds from Age Range by over2sd

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.