yil*_*lah 5 perl
是否可以使用Perl的shuffle,以便每次以相同的顺序生成输出?
Leo*_*erd 10
srand()始终使用具有相同种子值的函数(123在本例中).我得到:
srand()
123
$ perl -MList::Util=shuffle -E 'srand 123; say shuffle 1 .. 5' 41352
每次都可重复.没有srand()调用它就不同了.
归档时间:
10 年,3 月 前
查看次数:
389 次
最近记录: