> # 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?
Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery
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.
In reply to Re^2: Copy a builtin sub to a different name and then override ( goto &SUB )
by LanX
in thread Copy a builtin sub to a different name and then override
by bliako
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |