Hi Beech,
> # goto &CORE::hex; ## FAIL
I can't reproduce any problems with goto &SUB here.
Neither with hex nor with sleep .
How does it "fail" for you?
update
use strict;
use warnings;
warn "Version $]";
warn "Prototype", prototype "CORE::sleep";
my $sleepcounter;
BEGIN {
*CORE::GLOBAL::sleep = sub {
warn "start wrapper ($_[0])";
$sleepcounter += int $_[0];
goto &CORE::sleep;
};
}
warn "return: ", sleep 2.3;
warn "total sleep( $sleepcounter )";
Version 5.016003 at d:/Users/lanx/pm/core_sleep.pl line 4.
Prototype;$ at d:/Users/lanx/pm/core_sleep.pl line 5.
start wrapper (2.3) at d:/Users/lanx/pm/core_sleep.pl line 15.
return: 2 at d:/Users/lanx/pm/core_sleep.pl line 23.
total sleep( 2 ) at d:/Users/lanx/pm/core_sleep.pl line 25.
|