Perl: the Markov chain saw | |
PerlMonks |
Re: Re: Re: Re: Re: Re: has it been blessed?by rjray (Chaplain) |
on Mar 07, 2002 at 21:54 UTC ( [id://150150]=note: print w/replies, xml ) | Need Help?? |
The reason I wrote it that way is that ref($obj) is a single-opcode operation, much less expensive than the execution of UNIVERSAL::isa($obj, 'UNIVERSAL'). Unless you know for certain that the value being tested will a reference the majority of the time, then you can save a reasonable amount of execution time with ref() coupled with the short-circuiting and operator. I stand behind this one. --rjray
In Section
Seekers of Perl Wisdom
|
|