title: How can I determine the bitness of the OS using Perl on Windows?
body: <p>Using Perl, how can I determine whether my program is running on 32 bit Windows or 64 bit Windows?</p>
  
  <p>Is there any API available?</p>
  
  <p>I can think of a couple of options..</p>
  
  <ol>
  <li><p>Check the PE_HEADER of some windows file (eg: <code>c:\windows\explorer.exe</code>) - maybe I can use the details in <a href="https://stackoverflow.com/questions/495244/how-can-i-test-a-windows-dll-to-determine-if-it-is-32bit-or-64bit">How can I test a windows dll to determine if it is 32bit or 64bit?</a></p></li>
  <li><p>Check for the existence of <code>c:\program files(x86)</code> - if it exists then it is a 64 bit OS. Else it is a 32 bit windows OS.</p></li>
  </ol>
  
  <p>Is there any good way of doing this? Any API available in Perl?</p>