in reply to Re: restore overridden XS methods
in thread restore overridden XS methods
Subroutine gettimeofday redefined at z:\test.pl line 6. Constant subroutine gettimeofday redefined at z:\test.pl line 8. Modified: 42 Restored: 1172750176936000So, it works, kinda. With warnings.
But unfortunately, local does not work:
This results in the following compile time error:#! perl -w use strict; use Time::HiRes; { local *Time::HiRes::gettimeofday{CODE} = sub(){42}; print "Modified: ", Time::HiRes::gettimeofday,"\n"; } print "Restored: ", Time::HiRes::gettimeofday
Can't modify glob elem in local at z:\test.pl line 5, near "} =" Execution of z:\test.pl aborted due to compilation errors.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: restore overridden XS methods
by BrowserUk (Patriarch) on Mar 01, 2007 at 13:11 UTC | |
by bart (Canon) on Mar 01, 2007 at 13:26 UTC | |
by BrowserUk (Patriarch) on Mar 01, 2007 at 13:35 UTC | |
by bart (Canon) on Mar 02, 2007 at 01:11 UTC |