[kw-pm] a philosophical question about hashes

Robert P. J. Day rpjday at mindspring.com
Wed Jun 15 13:33:39 PDT 2005


  not so much a perl question as a software design question that just
happens to be associated with perl -- is it considered bad form to
create a hash in which each element's key is also one of its fields in
the corresponding value?

  obviously, there would be some redundancy there -- it would be
tantamount to, say, having a hash keyed on a social insurance number,
and the value being another hash, one of whose elements was, again,
the SIN.

  the duplication there just rubs me the wrong way, but i'm looking at
some existing code that has that property and i'm trying to convince
myself that there's no real justification for it.

  thoughts?

rday


More information about the kw-pm mailing list