#!/usr/bin/perl -w use strict; use Config; if ($Config{byteorder} == 4321) { print "Big endian\n"; } elsif ($Config{byteorder} == 1234) { print "Little endian\n"; } elsif ($Config{byteorder} == 87654321) { print "Cray\n"; } elsif ($Config{byteorder} == 3412) { print "Weird order\n"; } else { # Not sure if it can get here print "Unknown byte order\n"; }
In reply to Re: Detecting machine Endian-ness
by jmcnamara
in thread Detecting machine Endian-ness
by LunaticLeo
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |