# solution 1 use Config; if ($Config{'use64bitint'}) { # max_integer is probably 2**63-1 } else { # max_integer is probably 2**31-1 } #### # solution 2 my $max_int = (-1)>>1;