Much reading later - and thank you for all the references in your other post, only some of which I had read previously - I think I understand what you are doing. I do have some questions, though. Am I right in thinking that the (?i) has the same effect as an i qualifier with xmsr? If not, what is the difference (and where is it documented, please)? If so, and I appreciate that you have stated "my own preferred practices" which exempts you from needing a reason, is there a reason why you prefer to have the qualifiers separately?

How come none of the spaces in { \A (?i) \Q$startdir\E \\? } are treated as matchable characters? I suspect it's one of your qualifiers, but I couldn't find it explained in any of the docs I read, unless it's part of x, and I haven't looked for the documentation for that beyond reading that it means "extended regexes".

I find your final assignment ($var = $var =~ regex =~ regex) rather confusing, as it seems to need to work from left to right at some times and from right to left at others. I know things joining things like map, grep & sort result in the expression working right to left. I don't remember seeing three assignment-like = signs in a Perl statement before, which may be part of my confusion. Is the order irrelevant, and if not, what are the rules for the direction of evaluation?

Thanks and regards,

John Davies


In reply to Re^2: Combining regexes by davies
in thread Combining regexes by davies

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.