<p>According to this</p>

<p><a href="http://perldoc.perl.org/UNIVERSAL.html" rel="noreferrer">http://perldoc.perl.org/UNIVERSAL.html</a></p>

<p>I shouldn't use UNIVERSAL::isa() and should instead use $obj->isa() or CLASS->isa().</p>

<p>This means that to find out if something is a reference in the first place and then is reference to this class I have to do</p>

<pre><code>eval { $poss-&gt;isa("Class") }
</code></pre>

<p>and check $@ and all that gumph, or else</p>

<pre><code>use Scalar::Util 'blessed';
blessed $ref &amp;&amp; $ref-&gt;isa($class);
</code></pre>

<p>My question is why? What's wrong with UNIVERSAL::isa called like that? It's much cleaner for things like:</p>

<pre><code>my $self = shift if UNIVERSAL::isa($_[0], __PACKAGE__)
</code></pre>

<p>To see whether this function is being called on the object or not. And is there a nice clean alternative that doesn't get cumbersome with ampersands and potentially long lines?</p>

To directly answer your question, the answer is at the bottom of the page you linked to, namely that if a package defines an
```
isa
```
method, then calling
```
UNIVERSAL::isa
```
directly will not call the package
```
isa
```
method. This is very unintuitive behaviour from an object-orientation point of view.
The rest of this post is just more questions about why you're doing this in the first place.
In code like the above, in what cases would that specific
```
isa
```
test fail? i.e., if it's a method, in which case would the first argument not be the package class or an instance thereof?
I ask this because I wonder if there is a legitimate reason why you would want to test whether the first argument is an object in the first place. i.e., are you just trying to catch people saying
```
FooBar::method
```
instead of
```
FooBar->method
```
or
```
$foobar->method
```
? I guess Perl isn't designed for that sort of coddling, and if people mistakenly use
```
FooBar::method
```
they'll find out soon enough.
Your mileage may vary.