develooper Front page | perl.perl6.stdlib | Postings from August 2000

Re: Define consistent and standard

From:
skud
Date:
August 10, 2000 22:51
Subject:
Re: Define consistent and standard
Message ID:
20000811155130.A15832@netizen.com.au
On Mon, Aug 07, 2000 at 05:39:02PM +0200, Bart Lateur wrote:
>
>>* Hash names should be written so that looking up an element reads clearly:
>>	$email_address{Skud} reads as "the email address of Skud"
>>* Hashes with scalars as values should have singular names:
>>	my $address = $email_address{Skud};
>>* Hashes with arrayrefs or hashrefs as values should have plural names:
>>	my @addresses = @{$email_addresses{Skud}};
>
>I can relate to that.
>
>But those two groups of rules contradict each other. Or, do yo want
>$email_address{Skud} to be an element of the hash %email_addresses?

What I was trying to get across was that if you're storing more than one
email address per person, you might use %email_addresses and therefore
$email_addresses{Skud}, whereas if you're limiting it to one email
address per person, it would be $email_address{Skud}.

K.

-- 
Kirrily Robert -- <skud@netizen.com.au> -- http://netizen.com.au/
Open Source development, consulting and solutions
Level 10, 500 Collins St, Melbourne VIC 3000
Phone: +61 3 9614 0949  Fax: +61 3 9614 0948  Mobile: +61 410 664 994



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About