in reply to Is the documentation for Perl 5.20 'pack' correct?

The docs are correct.

For example, x86 is a LE platform, and byteorder is 1234 (32-bit IV) or 12345678 (64-bit IV) on that platform.

>perl -V:archname archname='MSWin32-x86-multi-thread'; >perl -V:byteorder byteorder='1234';
>perl -V:archname archname='MSWin32-x86-multi-thread-64int'; >perl -V:byteorder byteorder='12345678';

x64 is also LE.

>perl -V:archname archname='MSWin32-x64-multi-thread'; >perl -V:byteorder byteorder='12345678';

I don't have access to a BE platform to confirm that byteorder is 4321 or 87654321 there.

Replies are listed 'Best First'.
Re^2: Is the documentation for Perl 5.20 'pack' correct?
by BrowserUk (Patriarch) on Jul 07, 2015 at 00:15 UTC
    byteorder is 12345678 on that platform.

    That is a completely meaningless statement:

    print $Config{ archname };; MSWin32-x64-multi-thread $n = 0x12345678;; print unpack 'C*', pack 'V', $n;; 120 86 52 18 print unpack 'C*', pack 'NV', $n;; 18 52 86 120 0 0 0 0 print unpack 'C*', pack 'N', $n;; 18 52 86 120 print unpack 'C*', pack 'Q<', $n;; 120 86 52 18 0 0 0 0 print unpack 'C*', pack 'Q>', $n;; 0 0 0 0 18 52 86 120

    Until you define what the phrase "byteorder is 12345678" means; it means nothing useful.

    It could mean:

    • The decimal value 12345678, is stored in memory as ...
    • Or, the eight bytes of a 32-bit value are stored in memory as ...
    • Or, the hex value 12345678 is stored in memory as ...
    • Or, the sequence of ascii characters 12345678 is stored in memory as ...

    Except that the ... in any of those statements is not specified; which renders the statement -- whatever the intended interpretation -- completely meaningless.


    With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.
    I'm with torvalds on this Agile (and TDD) debunked I told'em LLVM was the way to go. But did they listen!
      STop making a fool of yourself and go read the docs as I previously suggested. We're talking about perl -V:byteorder.

        Until you define the meaning of the phrase "byteorder is 12345678", the statement is meaning less.

        Repetition is not an argument; nor a discussion.

        And nothing you've said so far is worth repeating!

        STop making a fool of yourself and go read the docs as I previously suggested. We're talking about perl -V:byteorder.

        Instead trying to pedant and boss folks, why don't you simply explain stuff?