in reply to Re^2: Finding nested directories from a string list.
in thread Finding nested directories from a string list.

As was stated elsewhere in this thread, you can sort on length instead. The parent will always sort before the child:
my @sorted_paths = sort { length($a) <=> length($b) } keys %paths;

-QM
--
Quantum Mechanics: The dreams stuff is made of