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 you3. 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
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |