my $x = *Time::HiRes::gettimeofday; ... change ... *Time::HiRes::gettimeofday = $x;