title: Using public and private methods inside their class in Perl 6
body: <p>If I have a public method, I can call it inside its class using both <code>$.name</code> and <code>self.name</code>:</p>
  
  <pre><code>class TEST {
    has Int $.a;
  
    method b($x) {
      return $!a * $x;
    }
  
    method c($y) {
      return self.b($y) * 3; # or $.b($y)
    }
  }
  
  my $m = TEST.new(a =&gt; 10);
  say $m.c(2); # 60
  </code></pre>
  
  <p>But if I make <code>b</code> a private method, I only can call it with <code>self!b</code>, not <code>$!b</code>, otherwise I get the following error message: </p>
  
  <pre><code>Attribute $!b not declared in class TEST
  </code></pre>
  
  <p>What's behind this rule? What are the rules of calling a method inside its own class?</p>