I'm looking for an easy way to determine if a system is 32-bit or 64-bit from Perl 5. I read the manual perlvar page back and forth and did not find a variable containing the CPU architecture of the system (the Perl processor architecture was compiled to get close enough). This is the closest I came:
chomp (my $arch = `uname -m`);
I was wondering if there was a more elegant way to define this; I hate relying on backward expressions because they are both a bottleneck, generally unsafe, and often (especially this example) violate cross-platform compatibility. There is no reason Perl should not have this information.
perl architecture
amphetamachine
source share