in reply to Extract and re-write

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

Replies are listed 'Best First'.
Re^2: Extract and re-write
by RCP (Acolyte) on Sep 02, 2004 at 14:28 UTC
    Thanks for your help, apparently I forgot some basic programming structuring. RCP