IMO, Text::Glob::glob_to_regex code is not too difficult to understand. If you had found an issue there you can try fixing it and submitting a patch.

Also, I don't quite remember the details, but a long time ago I found out that Text::Glob was not good enough for my purposes and so I wrote my own version (Net::SFTP::Foreign::Helpers::_glob_to_regex).

Retrospectively, what I learned from there is that rolling out your own version of a glob-to-regex compiler supporting basic wildcards is not too difficult. But then, last year, I had to write a feature rich glob-to-regex compiler (in Scala this time, scala-glob), and it got quite complex.

IIRC, one of the main limitations of Text::Glob is that you can not use it efficiently to match globs spanning more than a directory level (as in f*oo/b*ar/*.txt) against tree data structures like file systems.


In reply to Re: Edge case in Text::Glob by salva
in thread Edge case in Text::Glob by LanX

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.