Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: I need to know if 32-bit or 64-bit perl is running my script.

by DrHyde (Prior)
on Sep 16, 2013 at 10:36 UTC ( [id://1054272]=note: print w/replies, xml ) Need Help??


in reply to I need to know if 32-bit or 64-bit perl is running my script.

I do something like this:

$ perl -e 'eval { my @foo;$foo[2**32]="1" } || warn("Not big enough\n" +)'

That will warn with a 32-bit perl. However, the pointer size of an executable binary (and the libs it's linked against) doesn't necessarily tell you whether the OS is 32- or 64-bit. On many OSes (not sure about Solaris) a 32-bit binary can run on 32- or 64-bit OSes. Also beware that a perl with 32-bit pointers on a 32-bit OS can still, if compiled with the right options, have 64 bit integers and access large files.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (6)
As of 2024-04-25 18:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found