New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Documentation for 'srand' has a problem in code snippet #9048
Comments
From ben@linuxgazette.netCreated by ben@linuxgazette.net"perldoc -f srand" (and consequently, perlfunc.pod) contains the following: `` srand (time ^ $$ ^ unpack "%L*", `ps axww | gzip`); The problem is that 'ps axww | gzip' returns the same output every time, at `` The solution suggested in the error message (i.e., 'ps axww | gzip -f') Best regards, Perl Info
|
From @rgsOn 03/10/2007, via RT ben @ linuxgazette. net <perlbug-followup@perl.org> wrote:
Thanks, I've updated the docs accordingly. |
@rgs - Status changed from 'new' to 'resolved' |
The RT System itself - Status changed from 'new' to 'open' |
From ben@morrow.me.ukQuoth perl5-porters@perl.org:
This is only the case if gzip's stdout is a terminal (as it says). If ~% ps axww | gzip | cat Ben |
From nospam-abuse@bloodgate.comMoin, On Thursday 04 October 2007 00:06:13 Ben Morrow wrote:
The same on SuSE 10.1. In addition we should note that the documented time can be easily guessed - even if you guess it only to the hour you And since the expression just blindly XORs these bit together, you All the best, Tels PS: First email from Kubuntu 7.04 64 bit. Never, ever, touch a running -- "If you want to travel around the world and be invited to speak at a -- Linus Torvalds |
From @jkeenanOn Tue Oct 02 21:33:49 2007, ben@linuxgazette.net wrote:
In blead, it appears that pod/perlfunc.pod's section on srand() has been Is there any reason to keep this ticket open? Thank you very much. |
From @ikegamiOn Thu, May 3, 2012 at 10:03 PM, James E Keenan via RT <
The passage with deleted, not replaced. The docs say what not to do, but - Eric |
From @ikegamiOn Thu, May 3, 2012 at 10:17 PM, Eric Brine <ikegami@adaelis.com> wrote:
oh, call srand() with no args? Maybe something to that effect should be =Frequently called programs (like CGI scripts) that simply use= time ^ $$=for a seed can fall prey to the mathematical property that= a^b == (a+1)^(b+1)=one-third of the time. So don't do that. |
From @dcollinsnThis looks like an easy docs ticket with some suggested language already. Anyone have a small tuit to close this out? -- |
From [Unknown Contact. See original ticket]This looks like an easy docs ticket with some suggested language already. Anyone have a small tuit to close this out? -- |
@mauke - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#46019 (status was 'resolved')
Searchable as RT46019$
The text was updated successfully, but these errors were encountered: