# This implements the logical recursion that we use to # cheat the order find() imposes; #### `preprocess' The value should be a code reference. This code reference is used to preprocess a directory; it is called after readdir() but before the loop that calls the wanted() function. It is called with a list of strings and is expected to return a list of strings. The code can be used to sort the strings alphabetically, numerically, or to filter out directory entries based on their name alone. #### ... preprocess => sub { sort { -d $a <=> -d $b } @_ }, ...