Skip to content

Instantly share code, notes, and snippets.

@lopnor
Created December 14, 2010 03:02
Show Gist options
  • Save lopnor/739951 to your computer and use it in GitHub Desktop.
Save lopnor/739951 to your computer and use it in GitHub Desktop.
#!/usr/env/bin perl6
use v6;
{
my $foo = 'Foo';
require $foo;
my $obj = $foo.new;
say $obj;
say $obj.bar;
}
{
my $bar = 'Foo::Bar';
require $bar;
# my $obj = $bar.new; # this fails with 'Null PMC access in get_repr()'
my $obj = eval "{$bar}.new";
say $obj;
say $obj.baz;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment