title: How can I check if an object has a specific method?
body: <p>I want to use a method of an object.
  Like <code>$myObject-&gt;helloWorld()</code>.</p>
  
  <p>However there are a couple of methods so I loop through an array of method names and call the method like this:</p>
  
  <pre><code>my $methodName ="helloWorld";
  $myObject-&gt;$methodNames;
  </code></pre>
  
  <p>This works quite nice but some objects don't have all methods.</p>
  
  <p>How can I tell whether <code>$myObject</code> has a method called <code>helloWorld</code> or not?</p>