title: Best way to use "isa" method?
body: <p>What is the "best" way to use "isa()" reliably? In other words, so it works correctly on <strong>any</strong> value, not just an object. </p>
  
  <p>By "best", I mean lack of un-handled corner cases as well as lack of potential performance issues, so this is not a subjective question.</p>
  
  <p><a href="https://stackoverflow.com/questions/204316/why-shouldnt-i-use-universalisa/204368#204368">This question</a> mentions two approaches that seem reliable (please note that the old style <code>UNIVERSAL::isa()</code> should not be used, with reasons well documented in the answers to that Q):</p>
  
  <pre><code>eval { $x-&gt;isa("Class") }
  #and check $@ in case $x was not an object, in case $x was not an object
  
  use Scalar::Util 'blessed';
  blessed $x &amp;&amp; $x -&gt;isa($class);
  </code></pre>
  
  <p>The first one uses <code>eval</code>, the second uses <code>B::</code> (at least for non-XS flavor of Scalar::Util). </p>
  
  <p>The first does not seem to work correctly if <code>$x</code> is a scalar containing a class name, as illustrated below, so I'm leaning towards #2 (using <code>blessed</code>) unless somoene indicates a good reason not to.</p>
  
  <pre><code>$ perl5.8 -e '{use IO::Handle;$x="IO::Handle";
    eval {$is = $x-&gt;isa("IO::Handle")}; print "$is:$@\n";}'          
  1:
  </code></pre>
  
  <p><strong>Are there any objective reasons to pick one of these two approaches (or a 3rd one i'm not aware of) such as performance, not handling some special case, etc...?</strong></p>