Don't let the confusion of perlport and old Macs addle your brain too much. "A" isn't an uppercase A but is merely a logical uppercase A that stands in for the actual bit pattern that applies on that particular platform. When you talk to a SMTP server it doesn't want to hear "HELO" but to hear "HELO" in ASCII so, by the logic of perlport you should never send "HELO" but instead should hard-code the ASCII bit patterns for that. Sounds rediculous, doesn't it? The fact that people don't see it as rediculous when applied to "\n" are several.

"\n" is quite simply the newline character on the current platform.

The fact that old Macs claimed to be ASCII systems and so don't provide any translation layers to real ASCII and yet defined "\n" as something other than ASCII newline (but "\n" is still the newline character for old Macs), has caused a lot of broken thinking in the Perl world. I have a few nodes where I go into this in more detail.

Following the advice in perlport means that you write code that isn't portable unless you are on an ASCII system while just writing "\n" means that your code is portable to every system in the world except for old Macs. The popularity of old Macs vs. the popularity of Perl scripts on non-ASCII systems makes the balance here switch toward favoring portability to one single (somewhat broken) system over just coding portably. But the mental hoops that people have jumped through to try to rationalize the practice of making things that work on old Macs (while ignoring the existance of non-ASCII systems) are impressive and have caused tons of confusion.

Sorry, I don't have time to go into this further at this time. I'll try to throw in links to my prior discussions of this as I find time.

- tye        


In reply to Re^4: sprintf is printing unexepected output (Macs) by tye
in thread sprintf is printing unexepected output by thezip

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.