Clever. The only problem I see is that if there are other variable types attached to the name Time::HiRes::gettimeofday, such as $Time::HiRes::gettimeofday or @Time::HiRes::gettimeofday, that those will be overridden too.
I don't think it matters for this particular case — or even, in most cases.