Never mind I'm dumb I figured it out.

$para is the input variable for what text file I tell the script to read as input. I was telling it to read $lines whatever number from @lines limited by a match on a paragraph heading. Of course it's going to give me errors if it's matching the paragraph heading from each paragraph and the ($msisdn) isn't where it expected it to be. It needs to read from the whole file. With $para I just tell it to look in each paragraph for the ($msisdn) $/ already did all the work. I was telling it to be to exact. I was telling the script look on this line when I should've been saying look in each paragraph if you match this and this then print. Instead I was telling the script look for a match on these lines (I didn't even tell it to look through paragraphs I was just telling the script to look for matches on lines. God I feel dumb...I am dumb for making that mistake. I just had to sit back and realize that it was a simple answer. Aren't those the hardest ones though...The thing that gets overlooked. Sorry to bother everyone.

The Brassmon_k
PS. I think it's kind of BS. to get minus points for readability edits but hey I guess you do what you gotta do.

In reply to Re: Same pattern match different lines by brassmon_k
in thread Same pattern match different lines by brassmon_k

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.