Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

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

by BrowserUk (Pope)
on Sep 14, 2013 at 05:58 UTC ( #1054058=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.

Should work anywhere:

C:\test>\perl64\bin\perl -e"print length pack 'P', -1" 8 C:\test>\perl32\bin\perl -e"print length pack 'P', -1" 4

With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.


Comment on Re: I need to know if 32-bit or 64-bit perl is running my script.
Download Code
Re^2: I need to know if 32-bit or 64-bit perl is running my script.
by mbethke (Hermit) on Sep 14, 2013 at 06:58 UTC
    To see the userland code size that's a nice way. But if the kernel determines where stuff is placed in a struct and the kernel can run both 32- and 64-bit executables, you're still fuct. Plus some weird architectures like AS/400 (relevant for AIX) use 128bit pointers even on 32bit ALUs.
      But if the kernel determines where stuff is placed in a struct and the kernel can run both 32- and 64-bit executables, you're still fuct.

      That is certainly not the case for Intel processors. Even running under 64-bit kernels; 32-bit processes only use 32-bit pointers.

      Plus some weird architectures like AS/400 (relevant for AIX) use 128bit pointers even on 32bit ALUs.

      I know naff all about AS/400, but since the original AS/400 hardware was 48-bit; and it has all been 64-bit for the last decade or so; one wonders whether the question is even relevant for such hardware?


      With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      "Science is about questioning the status quo. Questioning authority".
      In the absence of evidence, opinion is indistinguishable from prejudice.
        True about the 32bit pointers, I just assumed Su^H^HOracle had changed something about the struct layout in 64bit versions. Otherwise the whole problem shouldn't exist as the change would be transparent to whatever C code retrieves the struct and passes it to Perl. In any case that's the leven the problem should be solved on. Actually I've never written anything for AS/400 either and especially with IBM's compatibility-back-to-the-60s fetishism you're right that it shouldn't matter at all. Wonder why the OP seemed to have a similar problem there.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (5)
As of 2014-12-20 21:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (99 votes), past polls