develooper Front page | perl.perl5.porters | Postings from July 2014

[perl #122351] srand(()) weirdness (note the empty list)

Thread Next
From:
yves orton
Date:
July 21, 2014 08:27
Subject:
[perl #122351] srand(()) weirdness (note the empty list)
Message ID:
rt-4.0.18-31316-1405931256-585.122351-75-0@perl.org
# New Ticket Created by  yves orton 
# Please include the string:  [perl #122351]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org/Ticket/Display.html?id=122351 >


Older perls misparse srand(()):

blead:/git_tree/perl$ perl -wle'print srand(())'
Use of uninitialized value in srand at -e line 1.
0 but true

Blead does things differently, but still not quite right, why the
uninitialized warning? and why the integer overflow warning?

blead:/git_tree/perl$ ./perl -wle'print srand(())'
Use of uninitialized value in srand at -e line 1.
Integer overflow in srand at -e line 1.
18446744073709551615

Yves

Perls:

$ perl -v

This is perl 5, version 14, subversion 2 (v5.14.2) built for
x86_64-linux-gnu-thread-multi
(with 80 registered patches, see perl -V for more detail)

$ ./perl -v

This is perl 5, version 21, subversion 2 (v5.21.2 (v5.21.1-192-gb6fbfd4*))
built for x86_64-linux
(with 32 registered patches, see perl -V for more detail)


-- 
perl -Mre=debug -e "/just|another|perl|hacker/"


Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About