Dear all,

Thanks to you for all your suggestions. I've started teaching myself PERL since 3 weeks, and had never come across the need to process multiple input files. Based on your responses, am I right in understanding the following?

1. I do NOT have to open as many file handles as the number of ARGV elements from command line?

2. I can build a merge of the lists in each input file into one held in memory and not an actual file

3. It is possible to compare this merge list in memory to the individual file lists from input? <\p>

Except I do not still understand how to do this comparison when opening multiple files with ONLY 1 file handle! I am a little lost here...My understanding is that the final merge list can be compiled only after reading the contents of the last input file, at which time the common file handle is pointing to the last file. So how can a comparison of the merge list to ANYTHING but the last file be made?

I know I am being naive, but I am sure Your Holiness' the Monks will be kind to a new initiate :)

Thanks to all those who wrote down partial and even FULL scripts, it is very sweet and kind of you. Since I am learning and very much a newbie, I would appreciate and benefit much more if you could point out an outline of logic and refer me to the operations/syntax that I should teach mysef to implement the most suitable algo for my work

Also, my example might have been misleading, my input files are not numbered, they have unrelated alphabetical names. And each of the files is not an array, it is more in the format of a 2 column Excel sheet, but as txt file. Entries in each line separated by tab, lines themselves separated by newline

Thanks again, I aspire to be as helpful and patient as all of you, one day! :)


In reply to Re^2: Open multiple file handles? by Anonymous Monk
in thread Open multiple file handles? by onlyIDleft

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.