# package IntTest; #These two lines are the culprit. Without them, it's fine use Math::BigInt; use Math::BigInt ':constant'; use Time::Local; use Exporter; use strict; BEGIN { use vars qw(@ISA); @ISA = qw(Exporter); our @EXPORT = qw(tdiff tconvert); } sub tdiff { my ($now, $then, $diff); ($now, $then) = @_; if (!$then) { $then = $now; $now = tconvert(); } $now = tconvert($now); $then = tconvert($then); $diff = int(($then - $now) / 60); return $diff; } #Take time and dates in the format yyyy-mmdd or yyyy-mmdd-hhmmss #and convert it to ticks sub tconvert { my $start = shift(@_); $start =~ s/-//g; my $year = substr($start, 0, 4); my $month = substr($start, 4, 2); my $day = substr($start, 6, 2); my $hour = substr($start, 8, 2); my $min = substr($start, 10, 2); my $sec = substr($start, 12, 2); $year = $year - 1900; $month--; my $now = timelocal($sec, $min, $hour, $day, $month, $year); return $now; } 1;