Skip to content

Instantly share code, notes, and snippets.

@shelling
Created February 22, 2012 06:37
Show Gist options
  • Select an option

  • Save shelling/1882490 to your computer and use it in GitHub Desktop.

Select an option

Save shelling/1882490 to your computer and use it in GitHub Desktop.
#!/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