version 1.0.0, 2013-10-23 : Initial version
Wanna know if your machine is little or big endian?
This one-liner tells you wether your computer uses little-endian or big-endian.This one-liner returns "little endian" if your machine is configured to use little-endian and "big-endian" if it’s configured for big!
perl -le 'print+(ord pack"s",1)?"little":"big","-endian"'
Or you can use the "Config" module like in the example bellow. If the returned
value begins with 1234
then you are on a little-endian machine. If it begins
with 4321
, then it is a big-endian one.
87654321
is for Cray and 3412
are for weird order.
perl -MConfig -le 'print$Config{byteorder}'