[Bioperl-l] Detecting type of an object.
Peter van Heusden
Thu, 12 Oct 2000 17:43:03 +0200 (SAST)
On Thu, 12 Oct 2000 firstname.lastname@example.org 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 email@example.com