Thread Ausgabe eines (komplexeren) Hashes: %hash (21 answers)
Opened by Duff at 2007-07-18 17:17

bloonix
 2007-07-19 13:07
#78620 #78620
User since
2005-12-17
1615 Artikel
HausmeisterIn
[Homepage]
user image
Vielleicht sowas?

Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
12
output(\%hash);

sub output {
  my $hash = shift;
  foreach my $key (sort keys %$hash) {
     if (ref($hash->{$key})) {
        output($hash->{$key}, @_, $key);
        next;
     }  
     print join(' : ', @_, $key, $hash->{$key}), "\n";
  }  
}


Das klappt natürlich nur mit HoH.\n\n

<!--EDIT|opi|1184836115-->
What is a good module? That's hard to say.
What is good code? That's also hard to say.
One man's Thing of Beauty is another's man's Evil Hack.

View full thread Ausgabe eines (komplexeren) Hashes: %hash