How would I open two files and join then into one file with file 1 output being column 1 and file 2 being column 2. for example:
file 1 looks like this
123455 c c
323333 c c
543212 c c
and
file 2 looks like this
fi1234 4 3
dtt234 4 3
3555t2 4 3
and i would want my joined file to look like this
123455 c c fi1234 4 3
323333 c c dtt234 4 3
543212 c c 3555t2 4 3
Ive tried something like the following which did not work.

open(IN, "file1") || or die; open(IN2, "file2") || or die; open(OUT, ">>joinfile") || or die; for my $file1 (<IN>) { chomp $file1; for my $file2 (<IN2>) { chomp $file2; print OUT "$file1 $file2\n"; } }
This printed everything in file 1 three times. Thanks for any help.

In reply to joining to files into columns by Anonymous Monk

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.