in reply to group based array sort
Cheers - L~R@list = sort { $a->{level} <=> $b->{level} } @list; # Print code goes here
Update: After re-reading your problem I realized the issue is not in the sorting but in the printing, which I conveniently left out. Since a great solution has already been provided below, I will only point to my iterative solution by using a stack.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: group based array sort
by benn (Vicar) on Feb 19, 2004 at 20:22 UTC |