First of all, file1 contains 31 lines, while the other two files contain 33 lines. This might be because the files are actually way bigger and you decided not to post more, or there *is* a difference, and you should check wheter you really want to join these files.

A nice GNU/non-Perlish way would be to do it straight from the command prompt with a few simple commands.
$ nl file2 > f2; nl file3 > f3; join -o 1.5,2.5 f2 f3 | paste file1 -
You might even pipe it to sed to get the formatting done a little nicer, but that's up to you :)

Not a Perl way, but a quick-n-dirty way to get the requested output.
--
b10m

In reply to Re: Merging 3 files by b10m
in thread Merging 3 files by xg

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.