Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

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

by wog (Curate)
on Jan 26, 2002 at 05:14 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://141707]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (3)
As of 2024-04-16 23:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found