A couple things to get this to work:
  1. you don't need to split the line on anything. But if you had you would need to change the /n to \n. Since you have not messed with $/, you will only be reading one line time from the file anyhow. If the purpose of this line (the one with split in it), was to put something in $line you would be better of just using: while (my $line = <IN>) { ... } If on the other hand the purpose was to remove the newline at the end of the string, well chomp has already done that for you.
  2. You need to add a closing brace between the print line and the close line.
If nothing else though Perl should have told you about the missing closing curly bracket, and should have also warned that split //n/ is invalid, the first time you attempted to run your program.

Anyhow, hope this helps. Though seriously, if you had problems with this you might want to head over to learn.perl.org, browse the online library there, or pick up a copy of the Learning Perl (aka The Llama), and also there are some fine Tutorials around here.

-enlil


In reply to Re: Making my file all one line by Enlil
in thread Making my file all one line 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.