Come for the quick hacks, stay for the epiphanies. | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Hello,
Is it possible to set fixed hash behavior: getting the same order of keys (or values, or each)? How scripts, output of which depend on hashes, are tested? E.g. once generated desired output, which is suitable for being a test case, won't be the same in the next run? Comparing to scripts which uses 'rand' one can set the same seed ('srand CONST') for getting the same output every time. Upd. E.g. I shuffled (10k times) an array with a hash, and got different patterns of shuffling occurrences between different script runs (see from here: Re: RFC: Kinda pseudo-shuffle using sort). In reply to Is it possible to "fix a seed" for hash? by rsFalse
|
|