hash of hashes

Discussion in 'Perl Misc' started by Imre, Jan 21, 2004.

  1. Imre

    Imre Guest

    Hello Community,

    can someone tell me how to traverse a hash of hashes to e.g. print out all elements?

    Thanks
    Imre
     
    Imre, Jan 21, 2004
    #1
    1. Advertising

  2. Imre

    Anno Siegel Guest

    Imre <> wrote in comp.lang.perl.misc:
    > Hello Community,
    >
    > can someone tell me how to traverse a hash of hashes to e.g. print out
    > all elements?


    use Data::Dumper;
    print Dumper \ %hoh;

    Anno
     
    Anno Siegel, Jan 21, 2004
    #2
    1. Advertising

  3. Imre

    Tore Aursand Guest

    On Wed, 21 Jan 2004 03:18:24 -0800, Imre wrote:
    > can someone tell me how to traverse a hash of hashes to e.g. print out
    > all elements?


    What have you tried so far? Where did you encounter problems? What
    didn't work as expected?

    Anyway: If you just want to visualize the hoh you got, you could use the
    excellent Data::Dumper module;

    use Data::Dumper;
    print Dumper( \%hoh );


    --
    Tore Aursand <>
    "Every man usually has something he can do better than anyone else.
    Usually it is reading his own handwriting." -- Unknown
     
    Tore Aursand, Jan 21, 2004
    #3
  4. Imre <> wrote:

    > Hello Community,
    >
    > can someone tell me how to traverse a hash of hashes to e.g. print out
    > all elements?


    Besides the useful Data::Dumper already recomended, there are examples in
    'perldoc perldsc', the data structures "cookbook".

    --
    David Wall
     
    David K. Wall, Jan 21, 2004
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. rp
    Replies:
    1
    Views:
    595
    red floyd
    Nov 10, 2011
  2. Scott  Gilpin
    Replies:
    2
    Views:
    238
  3. Perl Learner

    Hashes of hashes or just one hash ?

    Perl Learner, Jun 8, 2005, in forum: Perl Misc
    Replies:
    11
    Views:
    235
  4. Tim O'Donovan

    Hash of hashes, of hashes, of arrays of hashes

    Tim O'Donovan, Oct 27, 2005, in forum: Perl Misc
    Replies:
    5
    Views:
    237
  5. Replies:
    3
    Views:
    233
Loading...

Share This Page