On 3/2/07, Michael G Schwern <[EMAIL PROTECTED]> wrote:
Eirik Berg Hanssen wrote:
> Michael G Schwern <[EMAIL PROTECTED]> writes:
>
>> chromatic wrote:
>>> On Thursday 01 March 2007 17:46, Adam Kennedy wrote:
>>>
>>>> Actually, isn't UNIVERSAL::can($x, 'can') still valid? I seem to
>>>> remember that at one point it was considered the only valid use of
>>>> UNVERSAL::can directly.
>>> That's the only case I can think of too.
>> Hmm, that's a clever way of determining if something is an object.
>>
>> I guess UNIVERSAL::isa($thing, "UNIVERSAL") works, too.  And
>> UNIVERSAL::can($thing, "isa").
>
>   Not so if your $thing is a non-object sting that happens to be a
> package name ...

Oh yeah.  I guess it would have to be C<< ref $thing &&
UNIVERSAL::isa($thing, "UNIVERSAL") >>.

And the first person to point out it doesn't work if $thing is blessed into
class "0" gets their face dunked in pancake batter and fried.

Does defined( Scalar::Util::blessed )have cooties? Its the only
predicate you've ever had that actually works.

Josh

Reply via email to