jackdied has asked for the wisdom of the Perl Monks concerning the following question:

my Config.pm as installed doesn't support the i_limits query. It is a stock debian system, perl 5.6.1
use Config qw/config_vars/; print config_vars('i_limits'); prints i_limits='define';
Which is not very useful. I'm trying to find the maximum size of an int on the system to pre-generate a small lookup table to put in a C header file. It does know the size of an int on the system (in bytes), so I could calculate MAX_INT from that. That seems like the kind of kludge that Config.pm was meant to prevent!

Anyone know what the deal is?
If I can't trust Config.pm to work accross systems, is there another hack that is more portable?

TIA,

-jackdied

Replies are listed 'Best First'.
Re: Config.pm and i_limits
by Zaxo (Archbishop) on Aug 27, 2002 at 03:39 UTC

    Config.pm's i_limits = 'define' means that perl is honoring the C library definitions from the standard header limits.h. To get those definitions available to perl, run h2ph -a limits.h. Afterwards,

    require 'limits.ph';

    After Compline,
    Zaxo