in reply to Re: isa() on any scalar
in thread isa() on any scalar

Two things: i) are you building an OO module for phylogenetics? (If yes, let's join forces); ii) here's how I did it:
sub parent { my $self = $_[0]; if ( $_[1] ) { my $parent = $_[1]; if ( $parent->can('parent') ) { $self->[PARENT] = $parent; } else { my $ref = ref $self; carp "parents can only be $ref objects"; return; } } return $self->[PARENT]; }
This follows the "if it walks like a duck" paradigm. Not saying that this is the best way to do it, but it works for me.

Replies are listed 'Best First'.
Re^3: isa() on any scalar
by mrborisguy (Hermit) on Jun 11, 2005 at 21:05 UTC

    Phylogeny: (n.)
    1. The evolutionary development and history of a species or higher taxonomic grouping of organisms. Also called phylogenesis.
    2. The evolutionary development of an organ or other part of an organism: the phylogeny of the amphibian intestinal tract.
    3. The historical development of a tribe or racial group.

    Okay, just looked it up... nope, that's not what I'm doing at all. Sorry! Thanks for the piece of code though!

        -Bryan