C:\Users\Bill\forums\monks>type Existing_module.pm use strict; use warnings; package Existing_Module; sub Do_Something { print "Doing something.\n"; sleep(3); } 1 C:\Users\Bill\forums\monks>type bliako.t use strict; use warnings; use lib '.'; use Test::More tests => 2; use Existing_Module; our $total_sleep_time; BEGIN { *actual_sleep = *CORE::sleep; *CORE::GLOBAL::sleep = sub (;$) { $total_sleep_time+=$_[0]; actual_sleep($_[0]) } } sleep(2); is($total_sleep_time, 2, 'Local'); Existing_Module::Do_Something(); # Sleeps for 3 sec. is($total_sleep_time, 2+3, 'Module'); C:\Users\Bill\forums\monks>perl bliako.t 1..2 ok 1 - Local Doing something. not ok 2 - Module # Failed test 'Module' # at bliako.t line 21. # got: '2' # expected: '5' # Looks like you failed 1 test of 2.