The essential problem is that your inner while <FILEH> loop reads through to the end of the input file, so the outer loop printing "FIRST LINES" only ever executes once. Simply remove this inner read on the filehandle to solve the problem. Indenting the loops helps you see better what is going on.
while (<DATA>) { chomp; if (/overlaps/i) { tr/:)(/ /; s/,/ /g; ($xloc,$yloc,$name) = (split)[1,2,7]; print STDERR "FIRST LINES: $xloc $yloc $name\n"; } if (/from/i) { s/\(/ /g; s/\)/ /g; s/Pin/ /g; s/at/ /g; s/,/ /g; s/with/ /g; s/bounds/ /g; ($xloca,$yloca) = (split)[1,2]; print STDERR "SECOND LINES: $xloca $yloca\n"; } } __DATA__ Error: Trace to Pin violation on BACK with Clearance (0.3) Trace (2.97781,39.757),(7.85804,39.757) on Net (GND_SPI) of Size (0.25 +) overlaps Pin (P101-a4) at (4.05,41.025) on Net (/N$16294) of Size (1.84) (from: + Idea/LAYOUT/ROUTE 35) P101-a4 4.05 41.025 on Net /N$16294 of Size 1.84 from: Idea/LAYOUT/ROU +TE 35 Error: Pin to Fill_Area violation on IN2_GND with Clearance (0.3) Fill_Area (3.061,-14.425) (379.39,92.965) on Net (GROUND_CHASSIS) over +laps Pin (M200-g7) at (235.89,92.046) on Net (/I$13957/N$1243) of Size (1.2 +7). (from: Idea/Util/Fill 07) M200-g7 235.89 92.046 on Net /I$13957/N$1243 of Size 1.27. from: Idea/ +Util/Fill 07 Error: Fill_Area to Polygon violation on IN2_GND with Clearance (0.38) Fill_Area (-8.139,-15.475) (92.384,37.151) on Net (GROUND_CHASSIS) ove +rlaps Polygon with bounds (6.399,-5.228) (10.0989,-3.178). (from: Idea/Util/ +Fill 34) Polygon 6.399 -5.228 10.0989 -3.178. from: Idea/Util/Fill 34 Error: Trace to Trace violation on FRONT with Clearance (0.25) Trace (18.4375,79.2512),(18.7188,78.97) on Net (+3.3V) of Size (0.3) o +verlaps Trace (18.169,78.68),(18.169,80.27) on Net (/I$13956/I$68/N$14) of Siz +e (0.254) (from: Idea/LAYOUT/ROUTE 32) Trace 18.169 78.68 18.169,80.27 on Net /I$13956/I$68/N$14 of Size +0.254 from: Idea/LAYOUT/ROUTE 32

In reply to Re: Extract and re-write by Mr_Jon
in thread Extract and re-write by RCP

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.