develooper Front page | perl.perl5.porters | Postings from February 2003

[perl #20705] possible error in perl documentation?

Carsten Erdmann
February 4, 2003 13:10
[perl #20705] possible error in perl documentation?
Message ID:
# New Ticket Created by  Carsten Erdmann 
# Please include the string:  [perl #20705]
# in the subject line of all future correspondence about this issue. 
# <URL: >

Dear perlbug team,

I hope this is the correct address for error reports in the perl

In the documentation for the function "pack" occurs the following statement:

	For example a 4-byte integer
	0x12345678 (305419896 decimal) be ordered
	natively (arranged in and handled by the
	CPU registers) into bytes as

		0x12 0x34 0x56 0x78    # little-endian
		0x78 0x56 0x34 0x12    # big-endian

which seems to be wrong IMHO. As in big-endian architectures the most
significant byte is leftmost, the 4-byte integer 0x12345678 would be stored
in exactly this order on a big-endian machine. So the comments have to be
the other way round: the upper one is big-endian, the lower is
little-endian. I verified this on a (big-endian) HP under HP-UX and a
(little-endian) Intel machine under Linux.

Additionally, the order given above is opposite to the value reported by

Best regards,

Carsten Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About