Beefy Boxes and Bandwidth Generously Provided by pair Networks DiBona
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: How can I programatically determine the Endian-ness of the CPU?

by wog (Curate)
on Jan 26, 2002 at 05:14 UTC ( #141707=note: print w/ replies, xml ) Need Help??


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

In addition to checking Config as suggested by grep, you can use a solution provided by perlport. To quote:

If you need to distinguish between endian architectures you could use either of the variables set like so:
$is_big_endian = unpack("h*", pack("s", 1)) =~ /01/; $is_little_endian = unpack("h*", pack("s", 1)) =~ /^1/;


Comment on Re: How can I programatically determine the Endian-ness of the CPU?
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://141707]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (9)
As of 2014-04-17 22:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (458 votes), past polls