Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
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 all is quiet...

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (5)
As of 2017-02-25 21:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Before electricity was invented, what was the Electric Eel called?






    Results (369 votes). Check out past polls.