in reply to Map file-glob-style patterns to SQL "LIKE" expressions, with escaping

Way cool, but why the sort, and more importantly why the reverse ???

the lowliest monk

Replies are listed 'Best First'.
Re^2: Map file-glob-style patterns to SQL "LIKE" expressions, with escaping
by merlyn (Sage) on Mar 31, 2005 at 23:10 UTC
    "It's a trick!"

    It's to get longer things to appear before shorter things, so that the "\\" match is preferred over the "\" match, since it'll be first in the list (after a reversed sort). A simple sort-by-decreasing-length would have worked as well, but it takes more to type. :)

    -- Randal L. Schwartz, Perl hacker
    Be sure to read my standard disclaimer if this is a reply.