Created
December 14, 2010 03:02
-
-
Save lopnor/739951 to your computer and use it in GitHub Desktop.
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/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