reinaldo.gomes has asked for the wisdom of the Perl Monks concerning the following question:
I wrote a Perl script and I've been trying to print its own PID, which works fine when it's 32767 or lower. However, it is always shown as 32767 whenever the real PID is above this number. It seems like it's a size/signing limitation for the variable. In MySQL, that would be equivalent to SMALLINT being signed (-32768 to +32767) as opposed to being unsigned (0 to 65535).
Any ideas on how to solve this?
EDIT: Just to explain my stupidity: the problem was exactly what I said in my original post: MySQL INT column being signed instead of unsigned. The value I was seeing came from a select, not from a print. MySQL was limiting this value, not Perl.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: $PID/$$ capped at 32767?
by choroba (Cardinal) on Oct 30, 2017 at 23:07 UTC | |
by reinaldo.gomes (Beadle) on Oct 30, 2017 at 23:51 UTC | |
by syphilis (Archbishop) on Oct 31, 2017 at 01:04 UTC | |
by reinaldo.gomes (Beadle) on Oct 30, 2017 at 23:14 UTC | |
by holli (Abbot) on Oct 30, 2017 at 23:27 UTC | |
by reinaldo.gomes (Beadle) on Oct 30, 2017 at 23:46 UTC | |
Re: $PID/$$ capped at 32767?
by reinaldo.gomes (Beadle) on Oct 31, 2017 at 13:22 UTC | |
by RMGir (Prior) on Oct 31, 2017 at 14:16 UTC | |
Re: $PID/$$ capped at 32767?
by choroba (Cardinal) on Oct 31, 2017 at 13:22 UTC |
Back to
Seekers of Perl Wisdom