Using LibreOffice to graph the data as reported by your perl program and fit a line, I get the same result as the perl module.
I don't know enough Gnuplot to know what is going on there, but notice that the Asymptotic Standard Error is many times the values of the parameters. Event the perl data has a correlation coefficient of 0.02
You also have an error in the time conversion in the perl code.
return timelocal( '59', '59', '23', $d, $m, $y );
return timelocal( '59', '59', '23', $d, $m-1, $y );.
This will not effect the slope, just the y-intercept.