http://www.perlmonks.org?node_id=1054237


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

Why use external commands when everything and more is already available?

$ perl -V:ptrsize ptrsize='8'; $ perl -MConfig -wE'say $Config{ptrsize}' 8 $ perl -MData::Peek -MConfig::Perl::V -we'DDumper (Config::Perl::V::my +config ()->{config})'
{ alignbytes => 8, api_subversion => 0, api_version => 14, api_versionstring => '5.14.0', archlibexp => '/pro/lib/perl5/5.14.2/aix-64all', archname => 'aix-64all', bincompat5005 => undef, byteorder => 87654321, cc => 'xlc -q64', cccdlflags => ' ', ccdlflags => ' -bE:/pro/lib/perl5/5.14.2/aix-64all/CORE/pe +rl.exp', ccflags => '-q64 -DDEBUGGING -qlanglvl=extended -D_ALL_SO +URCE -D_ANSI_C_SOURCE -D_POSIX_SOURCE -qmaxmem=-1 -qnoansialias -DUSE +_NATIVE_DLOPEN -qlanglvl=extended -I/pro/local/include -q64 -DUSE_64_ +BIT_ALL -q64', ccversion => '11.1.0.8', config_args => '-Dusedevel -Duse64bitall -Uversiononly -Dinc_ +version_list=none -des', cppflags => '-DDEBUGGING -D_ALL_SOURCE -D_ANSI_C_SOURCE -D +_POSIX_SOURCE -DUSE_NATIVE_DLOPEN -I/pro/local/include', d_dlsymun => undef, d_longdbl => 'define', d_longlong => 'define', d_readlink => 'define', d_sfio => undef, d_sigaction => 'define', d_symlink => 'define', dlext => 'so', dlsrc => 'dl_aix.xs', dont_use_nlink => undef, doublesize => 8, exe_ext => '', gccosandvers => '', gccversion => '', git_branch => '', git_commit_id => '', git_commit_id_title => '', git_describe => '', git_snapshot_date => undef, git_uncommitted_changes => '', gnulibc_version => '', hint => 'recommended', inc_version_list => ' ', intsize => 4, ivsize => 8, ivtype => 'long', ld => 'ld', lddlflags => '-b64 -bhalt:4 -G -bI:$(PERL_INC)/perl.exp -b +E:$(BASEEXT).exp -bnoentry -lc -lm -L/usr/local/ppc64/lib64 -L/pro/lo +cal/lib', ldflags => '-L/usr/local/ppc64/lib64 -b64 -q64 -L/pro/loc +al/lib -brtl -bdynamic -b64', ldlibpthname => 'LIBPATH', libc => '/lib/libc.a', libperl => 'libperl.a', libpth => '/usr/local/ppc64/lib64 /lib /usr/lib /usr/ccs +/lib /usr/local/lib /usr/lib64', libs => '-lbind -lnsl -ldbm -ldb -ldl -lld -lm -lcrypt + -lc', longdblsize => 8, longlongsize => 8, longsize => 8, lseeksize => 8, lseektype => 'off_t', myuname => 'aix i3 3 5 0004898ad300 ', nvsize => 8, nvtype => 'double', optimize => '-O', osname => 'aix', osvers => '5.3.0.0', package => 'perl5', patchlevel => 14, path_sep => ':', perl_patchlevel => '', perllibs => '-lbind -lnsl -ldl -lld -lm -lcrypt -lc', privlibexp => '/pro/lib/perl5/5.14.2', prototype => 'define', ptrsize => 8, revision => 5, scriptdir => '/pro/bin', sitearchexp => '/pro/lib/perl5/site_perl/5.14.2/aix-64all', sitelibexp => '/pro/lib/perl5/site_perl/5.14.2', so => 'a', subversion => 2, use64bitall => 'define', use64bitint => 'define', useithreads => undef, uselargefiles => 'define', uselongdouble => undef, usemultiplicity => undef, usemymalloc => 'n', useperlio => 'define', useposix => 'true', useshrplib => 'false', usesocks => undef, usevendorprefix => undef, version => '5.14.2', version_patchlevel_string => 'version 14 subversion 2' }

Enjoy, Have FUN! H.Merijn