in reply to Re: sorting tree with folders on top
in thread sorting tree with folders on top

Add this
#fix dir for my $i (@arr){ $i->{dir} = $1 if $i->{path} =~ m{^(.+)/}; }
one step closer :)
/c/ /c/a1.mp3 /c/a2.mp3 /c/aa/ /c/bb/ /c/bb/aa1.mp3 /c/bb/aa2.mp3 /c/cc/