Deeper level of hashing

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

I am using (roughly) the following code.

my %counter = () ;

$counter = 'label1' ;
$counter = 14 ;
$counter = 'label1' ;
$counter = 14 ;

If I use:  for my $key(keys %counter), I get label11 and label12 as
I would like to run something like: foreach my $key(keys %
($counter(label11) )  )
and get 'parent' and 'hits' as the sub-keys.

Is there any quick way to do this but quicker than what? So let's say
is there a 'standard way' in which this is done? Or do I have to do it
the 'hard way' ? Define a sub-hash, and then assign it to the parent
hash as its key's value?

Re: Deeper level of hashing

Quoted text here. Click to load it

Do you mean something like this?

 foreach my $key (keys %}) {
    print "$key => $counter->\n";

Joost Diepenmaat | blog: | work: /

Site Timeline