Thank you. It's not the behavior of map or grep that was/is mysterious to me, but the particular use of "\e[${_}m", which looks like some manner of regex (which it isn't), and I couldn't figure out what it was supposed to be doing to the numbers. I got hung up on the presence of an open square bracket but no closing square bracket, and the ${_} which looks like some sort of default variable distinct from $_, but for which I could find no definition. If I understand right from afoken's comment, then ${_} substitutes in the values from the provided list, which is what I would have expected $_ to do in a map. Is there anywhere the ${_} form is documented so I could read up on it? I had read the various docs you pointed to and didn't find it there. If it is not a form of its own, why use the curly braces instead of just $_?

In reply to Re^13: Immediately writing the results of search-and-replace by elemkeh
in thread Immediately writing the results of search-and-replace by Anonymous Monk

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.