use Date::Calc 'Add_Delta_YM'; my $date_limit = sprintf( '%02d-%02d-%04d', reverse # Y M D --> D M Y Add_Delta_YM( sub { $_[5] + 1900, # year $_[4] + 1, # month $_[3], # and day 0, # less this many years -13, # and this many months }->(localtime), # from today ) );