I've toyed around with this a little bit and propose using the following format (starting around line 66 in your code)
if ($aircraft_id_1 eq $aircraft_id_2){
#print "$aircraft_id_1 eq $aircraft_id_2\n";
print OUTFILE "$line_1;$line_2\n";
}
else { print OUTFILE "$line_1\n"; }
and removing the earlier (line 45ish) print statement that only prints the line from the first file. This way you're figuring out all in one place whether or not you are printing just one line or several.
As best as I can tell your matching logic is fine. Or am I missing something?
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.