Regarding your reply, it seems I should have been more clear about the problems in your code:
- As written in the OP, your code either never enters the second while loop (because you've read an empty string from an input file) or else it goes into an infinite loop (because if $G2A = $RECI returns true, nothing happens to allow exiting the loop).
- As written, your handing of inputs from data files appears to be misguided; it's very unlikely that it can work the way you intend it to work.
- Based on your updates to the OP, and your replies to me and other monks, it seems like you don't really have a clear picture of an algorithm that will produce the results you want to get, and so far, we have not gotten from you a clear picture of the inputs and intended outputs.
I hope you understand what I'm saying. If not, you can ask for clarification.
But more importantly, see if you can provide a fairly simple, direct description of the task you are trying to accomplish: "(A) There are (how many?) different types of input files - here are brief examples of the content for each type: ... (B) Given these inputs, there's this particular type of match that I need to locate: ... (C) Each time I locate this sort of match, there's this particular information that needs to be output: ...." -- or something to that effect.
If you can't figure out how to express your task in a simple example, it's much harder for us to help you. But if you can do that, it should help you to get a fresh start on your script. (The OP script is unlikely to be a good starting point.)
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.