in reply to Attributes with new to manage parameters

Instead of using a ton of attributes, why not do something like
sub new : Attrs( 'name', 'nick', 'age', 'gender' ) { .... }
That way, the other attributes aren't clobbering potential other uses, like what Catalyst does.

My criteria for good software:
  1. Does it work?
  2. Can someone else come in, make a change, and be reasonably certain no bugs were introduced?

Replies are listed 'Best First'.
Re^2: Attributes with new to manage parameters
by GrandFather (Saint) on Sep 15, 2007 at 09:54 UTC

    That (and more, like providing validation information) occurred to me after posting the node. However the elegance of the original code seems to me to be just fine for a "simplest case" and can be embroidered to suit as circumstances require.


    DWIM is Perl's answer to Gödel