Thank you for your response, ww. The book in chapter 5 in fact covers how to write the regular expression to search data with grouping, and later  print it. I realize now how vague I was being in the question and have changed it to reflect that the regular expression will not be hardcoded, but be <STDIN>

Switching topics: you object to the author invoking chomp before introducing it. That's perhaps pedagologicly sound, but it also misses (missed?) a critical lesson about learning Perl!

To be specific he requests, in chapter 3 that you

3. Store your important phone numbers in a hash. Write a program to look up numbers by the person's name.

I assumed values from <STDIN> would just match, and up till that point chomp isn't mentioned nor is the fact that the <STDIN> function throws in a /n at the end of every entry. I was bashing my head against the wall when the hash wasn't matching the entry, even if (so far as I could tell) it matched verbatim. It was only after pouring over the nodes here for awhile that I discovered the chomp function and what it did.

That being said, I'm sort of glad it happened. It forced me to reach out and do some (?=) as you mentioned.


In reply to Re^2: exist backreference variable list? by PerlJam2015
in thread exist backreference variable list? by PerlJam2015

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.