in reply to sorting tree with folders on top

I somehow miss in your code a test whether a path represents a directory or a plain file (or a symlink to a directory or to a file etc.).

-- 
Ronald Fischer <ynnor@mm.st>

Replies are listed 'Best First'.
Re^2: sorting tree with folders on top
by diweooy (Novice) on Apr 07, 2009 at 10:56 UTC
    hash key 'file' represents files. folders do not have this key. that's why:
    if ($$a{'file'} && !$$b{'file'}) { return 1; } elsif (!$$a{'file'} && $$b{'file'}) { return -1; }