Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw

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 ( #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?

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

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (10)
As of 2019-07-23 14:04 GMT
Find Nodes?
    Voting Booth?
    If you were the first to set foot on the Moon, what would be your epigram?

    Results (27 votes). Check out past polls.