Help for this page

Select Code to Download


  1. or download this
    use v6.c;
    say $*PERL.compiler.version;
    ...
    }
    
    say my $obj = $class.new( foo => 1, bar => 1 );
    
  2. or download this
    v2016.04
    ClassC.new(foo => 1)
    
  3. or download this
    class ClassC { has $.foo }
    my %args = :foo;
    ClassC.new(|%args)
    
  4. or download this
    class C {}
    C.new(1)
    
  5. or download this
    class Duration ... {
        has Rat $.tai = 0;
    ...
        method new($tai) { self.bless: tai => $tai.Rat }
        ...
    }
    
  6. or download this
    say Duration.new(22); # Duration.new(tai => 22.0)