title: Passing objects to another class in Perl
body: <p>What happens when i do something like this:</p>
  
  <pre><code>$stallion = Horse-&gt;new(gender =&gt; "male");
  $molly = Mule-&gt;new(gender =&gt; "female");
  $colt = $molly-&gt;breed($stallion);
  </code></pre>
  
  <p>I cant comprehend what is going on on that code? </p>
  
  <ol>
  <li>What happens when that stallion reference is passed to another instantiation of class?</li>
  <li>And in that code is breed another method in another class?</li>
  <li><p>From that example, are there 2 different classes? (Horse class with a new method or constructor, Mule class with another new constructor).</p>
  
  <p>$colt = $molly->breed($stallion);</p></li>
  </ol>
  
  <p>From that code, my understanding is that <code>$molly</code> is just the same as the Mule class which have other method than <code>new</code> - <code>breed</code>. Am i right?</p>