Thread Nummerierte Liste / Baum aus nested structure machen (3 answers)
Opened by pktm at 2010-02-26 00:04

pq
 2010-02-26 00:47
#133699 #133699
User since
2003-08-04
12208 Artikel
Admin1
[Homepage]
user image
das könnte dann so aussehen:
Code (perl): (dl )
1
2
3
4
5
6
7
8
9
10
11
12
my @levels;
while (my $row = $sth->fetchrow_hashref) {
    my $level = $row->{level};                     
    $levels[$level]++;
    local $" = ".";
    print "@levels[0 .. $level] $row->{ident}\n";
}
__END__
1 root
1.1 a
1.1.1 b
1.2 c
Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live. -- Damian Conway in "Perl Best Practices"
lesen: Wiki:Wie frage ich & perlintro Wiki:brian's Leitfaden für jedes Perl-Problem

View full thread Nummerierte Liste / Baum aus nested structure machen