in reply to how to traverse thru this hash?

Assuming the hash is named %instructions:
for my $computer (keys %instructions) { my $commands = $instructions{$computer}; for my $comm (keys %$commands) { my $argument_sets = $commands->{$comm}; for my $args (@$argument_sets) { my @values = @$args; print "$computer: $comm: [@values]\n"; } } }
That should print
comp1: cmd2: [test2 type1 view1] comp1: cmd1: [test1 type1 view1] comp1: cmd1: [test2 type1 view1]
unless I made a mistake. The code is untested but looks ok to me.

Jeff japhy Pinyan, P.L., P.M., P.O.D, X.S.: Perl, regex, and perl hacker
How can we ever be the sold short or the cheated, we who for every service have long ago been overpaid? ~~ Meister Eckhart

Replies are listed 'Best First'.
Re^2: how to traverse thru this hash?
by kwaping (Priest) on Nov 03, 2005 at 22:46 UTC
    Is there any benefit to using "for" instead of "foreach", or is it just a style thing?
      My fingers are saved some work? Honestly, 'for' and 'foreach' are interchangeable in Perl syntax. Just read perlsyn.

      Jeff japhy Pinyan, P.L., P.M., P.O.D, X.S.: Perl, regex, and perl hacker
      How can we ever be the sold short or the cheated, we who for every service have long ago been overpaid? ~~ Meister Eckhart
        Thanks for that link. Interestingly enough, at the bottom of the foreach section in that document, this is written:

        And it's faster because Perl executes a foreach statement more rapidly than it would the equivalent for loop.

        So you might want to consider typing those four extra letters. :)