The last modified time is calculated from the same str2time
function that the expires time is. Changing the one line
inside Date.pm should fix both of those problems. The
missing content length on the first test of yours doesn't
seem to be a problem, as it's undef when there isn't one.