Thread Hash-Tree ausgabe CSV formatierung (5 answers)
Opened by Dakarus at 2013-12-18 12:09

Dakarus
 2013-12-18 13:03
#172646 #172646
User since
2013-12-17
3 Artikel
BenutzerIn

user image
Code (perl): (dl )
1
2
3
4
5
6
7
8
sub print_tree {
    my ( $tree, $parent, $chain ) = ( @_, $EMPTY, $EMPTY );
    ref $tree eq "HASH" or return;
    for ( sort keys %$tree ) {
        print /^\s*\z/ ? "<blank>" : "$parent;". "$chain"."$_", "\n";
        print_tree( $tree->{$_},  $_, "$chain"."$_"."_");
    }
}


... hab´s

modedit Editiert von pq: code-tags hinzugefügt
Last edited: 2013-12-18 13:22:51 +0100 (CET)

View full thread Hash-Tree ausgabe CSV formatierung