Adding to RichardK above: the byteorder string is not an integer value (hex or otherwise), it just gives the memory layout.

Interesting that human thinking seems to be inherently little-endian itself — the "1" for "first" corresponds with the least significant byte. Or more likely, it acknowledges the ranking or integer types: small values are a subset of bigger integers' values, so each larger type extends the range. In this sense, the extra bytes are additional hence enumerated in that order. But enough with Semiotics.

Glibc headers for example come with the following definitions in /usr/include/endian.h:

#define __LITTLE_ENDIAN 1234
#define __BIG_ENDIAN    4321
#define __PDP_ENDIAN    3412
... which allows for convenient testing a la #if __BYTE_ORDER == __LITTLE_ENDIAN; clearly this convention is not a perl quirk.


In reply to Re: Is the documentation ... correct (the name of the rose) by Anonymous Monk
in thread Is the documentation for Perl 5.20 'pack' correct? by flexvault

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.