in reply to Re: restore overridden XS methods
in thread restore overridden XS methods
doesn't seem to work for me :)
my $x = *Time::HiRes::gettimeofday; print "original: ", Time::HiRes::gettimeofday(), "\n"; # ... *Time::HiRes::gettimeofday = sub() { $x; }; # ^^ avoids "Prototype mismatch" print "restored: ", Time::HiRes::gettimeofday(), "\n";
prints:
original: 117275763140928 restored: *Time::HiRes::gettimeofday
(i.e. after having been restored, the function prints the stringified representation of the glob $x)
|
|---|