Created
October 25, 2018 10:02
-
-
Save dur-randir/bb09082b1663410e8029c6420a87b208 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
package Foo; | |
use overload '&{}' => sub { \&call_cplusplus }; | |
sub call_cplusplus { warn 42 } | |
sub new {return bless sub {}, shift} | |
package main; | |
my $obj = Foo->new; | |
use Scalar::Util qw/reftype/; | |
warn reftype $obj; | |
$obj->(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment