my $the_num = Math::BigInt->new(1234567890123545678); sub numbits { my $tester = Math::BigInt->new(shift); my $i = 0; do {$i++} while ($tester >>= 1); $i; } print numbits($the_num);