in reply to How can I programatically determine the Endian-ness of the CPU?

Use the Config module and $Config{byteorder}.

Straight from module docs:
byteorder From byteorder.U: This variable holds the byte order. In the following, larger digits indicate more significance. The variable byteorder is either 4321 on a big-endian machine, or 1234 on a little-endian, or 87654321 on a Cray +... or 3412 with weird order !


BTW doing a search of determine endian yeilded several results.

search is your friend

grep
grep> cd pub
grep> more beer
  • Comment on Re: How can I programatically determine the Endian-ness of the CPU?
  • Download Code