Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
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?
[Discipulus]: I bet and.. I won!! ;=)
[Corion]: Discipulus: Yes, very good spot!
[Discipulus]: a lucky programmer.. as napoleon used to say..

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (8)
As of 2018-05-25 15:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?