Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: Conditional inheritance strategy

by kcott (Archbishop)
on Oct 27, 2010 at 12:54 UTC ( [id://867704]=note: print w/replies, xml ) Need Help??


in reply to Conditional inheritance strategy

Basically this looks good. Here's a few thoughts and suggestions:

  • Your if-elsif has no else. In this case, handling missing or unknown source (as alluded to by bart) would be appropriate.
  • Consider making the source types case-insensitive.
  • Do you need to pass %args to _init()?
  • You may find it useful to have an _init() in My which calls $self->SUPER::_init().
  • Is there a reason to return $self in list context?

-- Ken

Replies are listed 'Best First'.
Re^2: Conditional inheritance strategy
by citromatik (Curate) on Oct 27, 2010 at 13:04 UTC

    Thanks for your answer.

    As for your specific suggestions, the code I posted is a simplification of the actual code that I have (where most of your thoughts have been addressed). I was interested in possible issues using the strategy.

    Thanks again

    citromatik

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (4)
As of 2024-04-25 05:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found