This isn't actually a Perl question. It's a question about operating system differences, and how text is represented on different platforms.

On some platforms text lines end in \012. In others, lines end in \015\012. And in others, lines end in \015. If you transfer files in "binary mode", line endings are not converted as you transfer across operating system platforms. If you transfer in text mode, line endings should be converted automatically.

Perl scripts are text files, not binary files. So if you want your Perl scripts to be transferred with the proper line endings, you use text mode when transferring them. Or, as an alternative, you can transfer them in whatever mode you please and then use the "dos2unix" or the "unix2dos" utilities to convert the line endings after the fact.

Again, this has nothing to do with Perl itself other than the fact that you can wreck a Perl script by failing to convert the line endings. In particular, people often notice that shebang lines stop working if the line endings aren't converted.


Dave


In reply to Re: FTPing by davido
in thread FTPing by pikus

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.