in reply to Re^5: Remove blank lines from REGEX output
in thread Remove blank lines from REGEX output
One can also take another tack and use a series of statements like
next if not proper_year($year);
next if not proper_month($month_nr);
next if not proper_day($day_in_month, $month_nr, $year);
which might be said to offer the best of both concision (it's self-documenting, or can be made so) and encapsulation (annual, monthly and daily proprieties defined in one place in their respective validation functions). This sort of approach is what I usually prefer if I have the opportunity to take a second pass at a program and consolidate.
Then there's the OO approach...