For this problem I would use the following algorithm:
read the first names from each file in name1, name2 and name3 while not (name1==name2 and name2==name3) { determine from which file came the name with the lowest alphabetica +l value read the next name from that file in the corresponding name1, name2 +, name3 variable } print name1, name2, name3
The nice thing about this algorithm is that it doesn't matter if you use files, pipes or sockets.

For the socket solution you would create three server processes and one client process. The client opens a socket to each of the servers. Each server process reads one of the files and writes the names one by one to the socket.

The perlipc man page shows several examples of clients and a server using IO::Socket. For the client you should not have to do anything more complex than the Simple client. The server can be simpler than the example shown; just remove all the prompts and command interpretation, and open the file and write the names to the client.

HTH


In reply to Re: sockets and such in Perl by raafschild
in thread sockets and such in Perl by scotchfx

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.