Update: My apologies for the confusion. The values have no space around the "=" which is why I am splitting it up by \s+. Also. Just to provide a little more clarification. I am trying to associate like values. So john.doe in this particular case correlates with john.doey. I need to associate these, and print them on one line. Where I need help is, I also need to extract doe, and doey, and print them on the same line. My criteria for matching values is:
/^john.doe/m /^john.doey/m /^doe/m /^doey/m
I need to explicitly associate john.doe with john.doey. If I use doe, and doey as my search strings, I run into issues with associating them correctly. So the suffix is common in all of the values I am looking for, however the prefix is different. Please let me know if I need to clarify further. Thank you so much for your help! Greetings Monks. Here is a little background. I am using LWP to grab a web page. The web page looks something like:
john.doe=18192812 tim=lasdflkdsajf john.doey=jr-1234 doe=12912039 bob=sdfasfd doey=jr-1235
So far I have split up the content and tossed it into an array:
@data = split /\s+/, $html_page;
This now gives me
@data = ("john.doe = 18192812", "tim = lasdflkdsajf", "john.doey = jr- +1234", "doe = 12912039", "bob = sdfasfd", "doey = jr-1235")
I need to grab the values from john.doe, and john.doey. I also need to grab the values from doe and doey. The goal is to correlate them and print them on one line as such.
print "$johndoevalue $johndoeyvalue\n"; print "$doevalue and $doeyvalue\n"
I am trying to figure out what the most efficient way to extract this is. Any help is mucho appreciado. Thanks!

In reply to Need to get multiple values. by frank_2k4

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.