Skip to content

Instantly share code, notes, and snippets.

@niner
Created August 29, 2014 20:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save niner/11490afd74ede2af7b8b to your computer and use it in GitHub Desktop.
Save niner/11490afd74ede2af7b8b to your computer and use it in GitHub Desktop.
class Perl5Object {
has OpaquePointer $!ptr;
has PerlInterpreter $!perl5;
submethod BUILD(:$!ptr, PerlInterpreter :$!perl5) {
}
method sink() {
self;
}
Perl5Object.^add_fallback(-> $, $ { True },
method ($name ) {
-> \self, |args {
warn self, $!perl5, $name if $!perl5.isa('Perl5Object'); # this prints: Perl5Object<140002120977768>Perl5Object<140002120977768>test
$!perl5.call($name, $!ptr, args.list);
}
}
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment