Created
May 12, 2010 23:38
-
-
Save schwern/399278 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| #!perl | |
| use strict; | |
| use warnings; | |
| use autobox; | |
| sub UNIVERSAL::mo { | |
| return Meta::Instance->new($_[0]); | |
| } | |
| { | |
| package Meta::Instance; | |
| sub new { | |
| my $class = shift; | |
| # Be careful to take a reference to an alias, not a copy | |
| return bless \$_[0], $class; | |
| } | |
| sub echo { | |
| my $self = shift; | |
| return $$self; | |
| } | |
| } | |
| print "UNIVERSAL"->mo->echo; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment