multidimentional hash that has both two and three keys
From: Trina Espinoza (trinasofia_at_hotmail.com)
Date: 01/30/04
- Next message: R. Joseph Newton: "Re: Objects and Arrays..."
- Previous message: R. Joseph Newton: "Re: How to put a variable value into a text file"
- Next in thread: Rob Dixon: "Re: multidimentional hash that has both two and three keys"
- Reply: Rob Dixon: "Re: multidimentional hash that has both two and three keys"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
To: beginners@perl.org Date: Thu, 29 Jan 2004 22:34:46 -0800
Can you have a multidimentional hash that has both two and three keys?
For example:
Array with two keys and a value:
$HASH-> {$VAR}{letter} ="a";
Same Array with three keys and a value:
$HASH->{$VAR}{$number){float} = "1.1";
$HASH->{$VAR} {$number}{integer}="2";
Is this possible? I'm not sure if it didn't wok b/c of an error in syntax or
if it's because it's not possible.
To print the two keys and value I know I do:
print $HASH->{$VAR}{letter};
BUT, if I have three keys and a value, how do I print it? If $number is a
different number every time (1 ..10), how do I get it to print so that it
iterates through each number and gives me the float and the integer for
each.
Hope this makes sense! Any examples would help get me started
Thanx!
_________________________________________________________________
High-speed users—be more efficient online with the new MSN Premium Internet
Software. http://join.msn.com/?pgmarket=en-us&page=byoa/prem&ST=1
- Next message: R. Joseph Newton: "Re: Objects and Arrays..."
- Previous message: R. Joseph Newton: "Re: How to put a variable value into a text file"
- Next in thread: Rob Dixon: "Re: multidimentional hash that has both two and three keys"
- Reply: Rob Dixon: "Re: multidimentional hash that has both two and three keys"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|