Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re^2: isa() on any scalar

by rvosa (Curate)
on Jun 11, 2005 at 20:41 UTC ( [id://465843]=note: print w/replies, xml ) Need Help??


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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://465843]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (2)
As of 2024-04-25 06:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found