There are two parts to this problem: (1) splitting the multi-digit string into component parts, as thoroughly shown; and (2) dealing with the date from that point on. For the latter, I go straight to packages like Date::Manip
. What these modules do is to treat "a date" as "an opaque
software object." You create one using whatever information you have, then you manipulate it however you need to do, then you get the result out in whatever printable format you need. You do not know how it represents its data; you do not care.