I'm not following your order, which may be a mistake, but anyway... "The /g on the third line makes that pretty much impossible to combine" is exactly the sort of guidance I was hoping to get.

"single character substitutions are better done with tr///" is not something I have seen documented anywhere. Is this a question of experience, or something I should have found for myself?

When I tried to sort out the backslash following the variable, I think I was trying to put it within the \Q\E part. Is this even possible? Things line \Q\E, quotemeta and qr are an area where my searches have been pretty fruitless. Are they identical? Are there any good docs on them?

A point on which I was expecting correction was another construct I tried to use without success. I have seen (and cargo culted) something like my ($plsname) = $curdir =~ regex;. Would that just mean having different operations on the same number of lines, or is there a better reason why it would be inappropriate here?

Thanks for the help & 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.