Subject: | Return value of srand(undef) |
I accidentally stumbled upon this oddity. There currently is a
discrepancy between what Math::Random::MT and Perl return when seeding
srand() with undef:
$ perl -e 'use Math::Random::MT qw(srand); print srand(undef)."\n";'
460165133
$ perl -e 'print srand(undef)."\n";'
0 but true
'0 but true' is a special Perl string that evaluates as true but also
behaves as the number zero. I am not sure why srand(undef) does not
return a proper seed instead of this value. If there is a good reason,
then Math::Random::MT should probably also ensure that it returns '0 but
true' when needed.
Florent