[kw-pm] a philosophical question about hashes
Robert P. J. Day
rpjday at mindspring.com
Thu Jun 16 10:30:11 PDT 2005
On Thu, 16 Jun 2005, John Macdonald wrote:
> There are certainly times when having the key inside the value is
> useful. If you have a subroutine that operates on a single value
> record, it could easily need to know the value of the key as well as
> the others parts of the record. It's easier to pass it a single
> coherent value than to have to pass the key as well.
>
> process_record( $structure{$_} ) for (@interesting_keys);
in the general case, of course, if i want multiple keys, i'd create a
hash value structure that contained all of those key values, then just
create distinct hashes for each key. but i don't think i need to get
that carried away just yet.
rday
More information about the kw-pm
mailing list