[Bioperl-l] Detecting type of an object.
Peter van Heusden
Thu, 12 Oct 2000 17:43:03 +0200 (SAST)
On Thu, 12 Oct 2000 email@example.com wrote:
> I'm not sure why you want to test the object type in this case. Anyway, you
> can ask
> $class_name = ref($obj);
> # branch depending on the value of class_name
->isa (after a ref() test, of course) is safer than branching on
$class_name, since it deals with inheritance (i.e. what if you're actually
getting a Bio::MySeq back, which isa Bio::Seq, from the method).
Peter van Heusden firstname.lastname@example.org