in reply to Recursion question...
Better yet, don't use the array, and use the default sort().
Notice how I left out the {$a cmp $b} part -- that's how sorting behaves by default.if (@children) { print "<li>[$rec{'ID'}] $rec{'Subject'}<ul>\n"; for my $child (sort @children) { do_tree($child); } print "</ul></li>\n"; }
_____________________________________________________
Jeff[japhy]Pinyan:
Perl,
regex,
and perl
hacker.
s++=END;++y(;-P)}y js++=;shajsj<++y(p-q)}?print:??;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Recursion question...
by c0d34w4y (Acolyte) on Dec 15, 2001 at 13:13 UTC | |
by japhy (Canon) on Dec 15, 2001 at 19:54 UTC | |
by c0d34w4y (Acolyte) on Dec 15, 2001 at 23:23 UTC |