- or download this
# This Perl 5 exporting code...
require Exporter;
...
# ...becomes this in Perl 6:
sub foo(...) is export {...}
- or download this
# Perl 5
sub get_foo {
...
$obj.foo = "...";
# Notice: Standard assignment syntax!
# Assignments should look line assingments, not like method calls
- or download this
has $.foo is rw;
- or download this
subtype OddInt of Int where { $^n % 2 == 1 }
has OddInt $.foo is rw;
# And then:
$obj.foo = 12; # will die (at compile-time!)