Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
i tested a program under 5.42 and 5.38 and it worked the same on both versions. on how many computers would this program produce the expected output?
/usr/bin/perl -v This is perl 5, version 38, subversion 2 (v5.38.2) built for x86_64-li +nux-gnu-thread-multi /usr/bin/perl -E 'srand(80085);say(join("",map({g($_)}("3f5a6471135061 +5c5b4f5867114c5666521f59535b604e57"=~m/../g))));sub g($num){chr(hex($ +num)+int(rand(31)));}' Just another Perl hacker
perl -v This is perl 5, version 42, subversion 0 (v5.42.0) built for x86_64-li +nux perl -E 'srand(80085);say(join("",map({g($_)}("3f5a64711350615c5b4f586 +7114c5666521f59535b604e57"=~m/../g))));sub g($num){chr(hex($num)+int( +rand(31)));}' Just another Perl hacker
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: how portable is the random number generator?
by haukex (Archbishop) on Jan 11, 2026 at 08:27 UTC | |
by haukex (Archbishop) on Jan 24, 2026 at 15:40 UTC | |
|
Re: how portable is the random number generator?
by afoken (Chancellor) on Jan 13, 2026 at 16:52 UTC | |
by Anonymous Monk on Jan 13, 2026 at 21:16 UTC | |
|
Re: how portable is the random number generator?
by ikegami (Patriarch) on Jan 13, 2026 at 01:46 UTC | |
|
Re: how portable is the random number generator?
by sectokia (Friar) on Jan 25, 2026 at 22:30 UTC | |
by choroba (Cardinal) on Jan 25, 2026 at 22:39 UTC | |
|
Re: how portable is the random number generator?
by harangzsolt33 (Deacon) on Jan 13, 2026 at 02:39 UTC |