\015 is equivalent to \r and \012 is sometimes equivalent to \n. The sometimes is the reason people often use the octal codes instead of the symbolic versions. Depending on a number of things I'm not quite sure about (I think the primary thing is what operating system you're using), \n can return different things (\012, \015\012, and maybe even sometimes \015). Since a goal of writing good network applications is following protocol specifications as closely as possible, some coders find the extra precision granted by using the octal codes to be worth the (imho) ugliness. I'll leave the decision up to you. 8^)

As for the last question, \r is carriage return. Think of a typewriter -- there are two distinct operations when you whack the Return key. First the paper scrolls up a little bit, then the type head returns to the far-left position. The first operation is called line feed, and the second is called carriage return (you might now understand why \r\n newlines are also called CRLF, if you've ever run into that initialism).


In reply to Re: Escape characters question by revdiablo
in thread Escape characters question by hweefarn

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.