Given in answer to a clpmisc post (thread @ GG) asking for a sort based on "directories first, then symlinks, then common files." Barely reported by me, who found the contribution precious in terms of compactness and elegance.

Update: minor correction avoiding an unnecessary stat as per another poster's remark.

my @typed_names = map {substr $_,1} sort map {(-l) ? "l$_" : -d _ ? "d$_" : "r$_"} @ARGV;