in reply to How to portably determine integer limits?


One way is to use the core Config module and calculate the limits from the byte size:
#!/usr/bin/perl -wl use Config; print $Config{intsize};
Another way, as you guessed, is with POSIX:
use POSIX; print POSIX::INT_MAX; print POSIX::INT_MIN; print POSIX::UINT_MAX;

Or perhaps even this:

print 0.5 * (-1 + unpack "I", pack "I", -1); print 0.5 * (-1 - unpack "I", pack "I", -1); print unpack "I", pack "I", -1 ;

--
John.