-
-
Save shelling/1882490 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
| #!/usr/bin/perl6 | |
| my @hello = "hello", "world"; | |
| say @hello.perl; | |
| for @hello -> $item { | |
| say $item | |
| } | |
| my %pair = ( | |
| foo => "bar" | |
| ); | |
| say %pair.perl; | |
| sub do_something ( Str $foo, Int $bar ) { | |
| "foo is $foo, bar is $bar"; | |
| } | |
| say do_something("google", 3); | |
| class Hello { | |
| method hello(Str $name, Int $age) { | |
| "Hello, I am $name, my age is $age" | |
| } | |
| } | |
| say Hello.new.hello("shelling", 26); | |
| role Walk { | |
| } | |
| class World is Hello does Walk { | |
| } | |
| say World.new.hello("shelling", 26) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment