From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> 
> 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}.

Makes sense after a fashion. Though I'm a little out of fashion ;)

  Scalar = thing
  Hash   = thing(s)
  Array  = thing(s)

That is fundamental an unalterable. Storing a reference to an array in a
scalar, is still storing "a" reference. When I see $email_address, I know
I'm seeing a single thing. When I see %email_addresses, I know it'll hold
one or more things.

Determining the plurality of a hash or array's name based on the content of
their values as Kirrily/Netizen suggest, is fine so long as the programmer
adheres to the naming convention. Still, what's a person to name a hash when
it holds something motley like:

%email_addresse(s)? = (Skud => [qw([EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED])],
                       dud  => '[EMAIL PROTECTED]');

On the other hand, if you advise making all scalars singular nouns, and all
hashes and arrays plural, then you don't have the self-imposed worry about
the contents of your arrays and hashes. If you name your hash
%email_addresses, you can fill it hash with scalars values one week and
anonymous hashes the next (or mix-and-match). You don't need to go through
your code and update $email_address{Skud} to $email_addresses{Skud}. 

Garrett

Reply via email to