Error parsing time at /usr/lib/perl5/site_perl/Time/Piece.pm line 481.
my $ddate = "$month / $day / $year";
my $tmp = Time::Piece->strptime( $ddate, "%m / %d / %Y");
You'll have to use something other than Time::Piece if you want to deal with timestamps before 1970. DateTime supports those (though time zone data might be sketchy if you go too far back).
$ perl -MDateTime -E' say DateTime->new(year => 1013, month => 2, day => 22) ->strftime("%a"); ' Mon $ perl -MDateTime::Calendar::Julian -E' say DateTime::Calendar::Julian->new(year => 1013, month => 2, day => 22) ->strftime("%a"); ' Sun