Created
August 19, 2009 16:56
-
-
Save shelling/170458 to your computer and use it in GitHub Desktop.
modifying symbol table at runtime
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/evn perl | |
# this simple script demostrate modifying symbol table at runtime | |
use 5.010; | |
package Hello; | |
sub hello { | |
"hello"; | |
} | |
package main; | |
say Hello->hello; | |
*{Hello::hello} = sub { | |
"modified"; | |
}; | |
say Hello->hello; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment