XP is just a number | |
PerlMonks |
Repeatable rand() and keys() for debuggingby ibm1620 (Hermit) |
on Dec 09, 2022 at 17:14 UTC ( [id://11148687]=perlquestion: print w/replies, xml ) | Need Help?? |
ibm1620 has asked for the wisdom of the Perl Monks concerning the following question:
Hello Perlmonks, I'm having trouble debugging a heavily random program because I'm unable to force it to repeat its behavior. After reading perlrun and web-searching a bit I concluded that the following snippet at the top of the program might do the trick: In addition to calling rand() to choose an array index, it also traverses lists of key(%hash). As far as I know, those are the only places where randomness can occur. (No hashes are modified after they're constructed at initialization.) I gather from perldoc perlrun ("this mode is as close to pre 5.18 behavior as you can get.") that perhaps there are no guarantees anymore? Can anyone suggest what I might be doing wrong or overlooking?
Back to
Seekers of Perl Wisdom
|
|