Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: What data structure is this code looking for

by wfsp (Abbot)
on Nov 15, 2011 at 15:21 UTC ( #938197=note: print w/replies, xml ) Need Help??


in reply to What data structure is this code looking for

A hash of hashes (HoH)
#! /usr/perl/bin use warnings; use strict; use Data::Dumper; my $abc = { one => { oneone => 11, onetwo => 12, }, two => { twoone => 21, twotwo => 22, } }; foreach my $key (keys %{$abc}) { if ( ref $abc->{$key} eq 'HASH' ) { for my $subkey (keys %{$abc->{$key}}){ printf qq{%s -> %s\n}, $subkey, $abc->{$key}{$subkey}; } } }
onetwo -> 12 oneone -> 11 twotwo -> 22 twoone -> 21

Replies are listed 'Best First'.
Re^2: What data structure is this code looking for
by mhearse (Chaplain) on Nov 15, 2011 at 15:52 UTC
    Thanks for the replies. I actually figured this out moments after the post. Is it possible to delete my own posts?
      Nooo! Don't delete it. It's a good question and will be useful for others facing the same problem.
      The post is doing no harm. It might help other users searching on this site for helpful threads. You can edit your posts, but if you remove the text the answers to your post would hang there without meaning

        Additionally, if you do edit your content to a point where the meaning is lost or later posts become nonsensical, there will likely be a consideration request to restore the content.

        --MidLifeXis

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://938197]
help
Chatterbox?
[marto]: hopefully next year I'll be in a position to go to Perly things in Europe :)
[Corion]: Maybe I'll use the Real Jekyll a bit to get a feel for how it actually works, and to get annoyed by it ;)
[Corion]: marto: That would be cool :) There is no kids care at Perly events unfortunately, so it's not entirely family friendly
[Corion]: I think I should define a set of (say) five projects through which I rotate from time to time, just to prevent myself from being bored/annoyed by the problems they get stuck in ;)
[marto]: Corion, not bringing the kids would make it ideal :P
[marto]: a suggestion, have one project in the list that isn't programming/perl related
[Corion]: marto: Yeah, things are more parent-friendly the way they are ;))
[marto]: some hardware/makey thing
[Corion]: marto: Ah, I'm currently drifting to that again, over"painting" (well with Inkscape) one of my photographs and thinking about vectorizing some other images ...
[marto]: Corion, yes something 'artistic', so that or some music. Even combine some things, build a musical instrument :)

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (8)
As of 2017-07-27 07:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I came, I saw, I ...
























    Results (404 votes). Check out past polls.