use constant WEEK => 60 * 60 * 24 * 7; my $expiry_date = sprintf '%04d-%02d-%02d', sub { $_[5]+1900, $_[4]+1, $_[3] }->(localtime(time + 2 * WEEK));