SPUG: HASH help
Can Subaykan
cansubaykan at hotmail.com
Thu Jul 25 17:25:14 CDT 2002
see if this model helps, if you need more info look at chapter 9 "data
structures" in the camel book (3rd Ed)
%people = ( john => {akas => [jack, johnny],
pets => [bird, spider, coyote],
talents => [eating, sleeping]},
jacko => {akas => [michael, mike, mikhail],
pets => [elephant, llama, bubbles],
talents => [singing, dancing, scandals]},
pres => {akas => [george, dubya, bush],
pets => [dog, cat, horse],
talents => [bombing, misspelling, choking]}
);
print "john's first pet is $people{john}->{pets}->[0] \n"; # bird
print "pres's second talent is $people{pres}->{talents}->[1] \n"; #
misspelling
----Original Message Follows----
From: "Baker, Stephen M" <stephen.m.baker at intel.com>
To: "'spug-list at pm.org'" <spug-list at pm.org>
Subject: SPUG: HASH help
Date: Thu, 25 Jul 2002 14:07:10 -0700
I need to make a multi-dimensional hash. The top level has "$user" as keys,
and the values are references to another hash, hash2. Hash2 has "$item" as
keys, and the values are references to an array. The array has any number
of element in it... the goal being to be able to create a portable database
wherein the following is possible:
by specifying a user, you can look to see the various items
associated with them, and then get specifics about any of those items...
I need a starting point... I'm somewhat familiar with perl but if anyone
could give me some direction that would be helpful.
Stephen Baker Office: 253.371.4188
Intel Corporation Mobile: 253.678.0556
Intel Architecture Group Email:
stephen.m.baker at intel.com
Mail Stop DP3-307 2800 Center Dr. Dupont, WA 98327
****************************************************************************
**************
The information contained in this email are the opinions and views of the
author(s), and are not on behalf of Intel unless specifically stated.
****************************************************************************
**************
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
POST TO: spug-list at pm.org PROBLEMS: owner-spug-list at pm.org
Subscriptions; Email to majordomo at pm.org: ACTION LIST EMAIL
Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address
For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest
Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org
_________________________________________________________________
Chat with friends online, try MSN Messenger: http://messenger.msn.com
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
POST TO: spug-list at pm.org PROBLEMS: owner-spug-list at pm.org
Subscriptions; Email to majordomo at pm.org: ACTION LIST EMAIL
Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address
For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest
Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org
More information about the spug-list
mailing list