good chemistry is complicated, and a little bit messy -LW |
|
PerlMonks |
Re: Is the documentation for Perl 5.20 'pack' correct?by flexvault (Monsignor) |
on Jul 07, 2015 at 23:12 UTC ( [id://1133657]=note: print w/replies, xml ) | Need Help?? |
I have the following script which I ran on 2 different machines: The results were: The results agree with Writing endian-independent code in C. My knowledge of big-endian came from writing machine to machine transfer software for IBM in the '70s. The background was that IBM 32-bit mainframes were big-endian and expensive, and the new in-expensive (???) 8-bit boxes were little-endian. As you can see the 'N' and 'V' 'pack' formats are the same on both architectures but the native formats are different. Perl's 'pack' is correct, but the documentation examples are incorrect. Regards...Ed "Well done is better than well said." - Benjamin Franklin
In Section
Seekers of Perl Wisdom
|
|