http://www.perlmonks.org?node_id=1042348


in reply to sorting dates in YYYYMMDD format

Please describe in your own words what the variables $c and $d are supposed to contain. Maybe print them out to verify your assumptions.

Have you noticed that dates in YYYYMMDD format can be sorted directly with sort? This is one of the major advantages of using YYYYMMDD as a date format.