use Time::HiRes qw(gettimeofday);
$start_time = gettimeofday();
$global_variable = "hello!";
for ($i = 0; $i < 10000000; $i++) {
# replace this with "my"
local $global_variable = "redefined. . ";
}
print gettimeofday - $start_time." seconds\n";
print "$global_variable\n";
####
31.4016380310059 seconds
hello!
##
##
14.1771370172501 seconds
hello!