The rand function in C returns a random integer. The OP's C code seems to assume 16 bit integers, so that's a max of 65535 (or 32767 to -32768, IIRC). So, I think the equivalent Perl code would be something like:
$gcheck = sprintf "%x", ((int(rand(65536)) << 16) | int(rand(65536)));
bbfu
Black flowers blossom
Fearless on my breath
In reply to Re2 (rand() in C): A little C code converted to Perl *HELP*
by bbfu
in thread A little C code converted to Perl *HELP*
by regnab
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |