Re: values of hash of hash
- From: ngoc <ngoc@xxxxxxxxx>
- Date: Thu, 01 Sep 2005 12:15:34 +0200
My nummeric key is example only. My real application has keys that mix of text and number.
My problem is, I have to compare data from two projects and find out duplicated data. Two projects presented as two hash. If first level key is different (using exist function), put the whole data attached to it in an array. Currently, I have to access level 2, level 3 keys before getting it's real value. It is not advanced computing. So I want to access all values without using keys. Using "values %hash" just gives me next level hash.
Matija Papec wrote:
On Thu, 01 Sep 2005 11:27:32 +0200, ngoc <ngoc@xxxxxxxxx> wrote:
I have $hash{1}{2}{3} = 7; $hash{1}{4}{5} = 6; I want to get 7 and 6 without using three for loop and keys function How can I do it?
use Data::Dumper; my $s = Dumper \%hash; my @numbers = $s =~ /([76])/g;
:)
btw, is there a reason for using a hash? perhaps you could be better with arrays (all you keys are numeric).
.
- Follow-Ups:
- Re: values of hash of hash
- From: Matija Papec
- Re: values of hash of hash
- From: Anno Siegel
- Re: values of hash of hash
- References:
- values of hash of hash
- From: ngoc
- Re: values of hash of hash
- From: Matija Papec
- values of hash of hash
- Prev by Date: FAQ 3.1 How do I do (anything)?
- Next by Date: Re: A program to measure flops in Perl (should it be this "off"?)
- Previous by thread: Re: values of hash of hash
- Next by thread: Re: values of hash of hash
- Index(es):
Relevant Pages
|