Good point. I don't do anything with "wide" strings in Perl yet so I usually forget to take that into consideration. But here we are making the strings so we know they'll be byte strings and we can use what I wrote or: length pack "I", 0 to find the number of bytes in an IV.
I thought I had used a "native 32-bit integer" before for endianness testing, but for some reason couldn't think of "L". That certainly makes more sense than resorting to substr. (:
- tye (but my friends call me "Tye")In reply to (tye)Re2: Detecting machine Endian-ness
by tye
in thread Detecting machine Endian-ness
by LunaticLeo
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |