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 ... [EMAIL PROTECTED]:39:06]~$ perl -le '$thing = "main"; print for UNIVERSAL::can($thing, "isa"), UNIVERSAL::isa($thing, "UNIVERSAL"), eval { $thing->UNIVERSAL::can("can") }' CODE(0x8130278) 1 CODE(0x81302b4) [EMAIL PROTECTED]:39:18]~$ Sorry; I got nothing. Eirik -- All bridge hands are equally likely, but some are more equally likely than others. -- Alan Truscott