如何使List :: Util'shuffle'在Perl中重现相同的输出

yil*_*lah 5 perl

是否可以使用Perl的shuffle,以便每次以相同的顺序生成输出?

Leo*_*erd 10

srand()始终使用具有相同种子值的函数(123在本例中).我得到:

$ perl -MList::Util=shuffle -E 'srand 123; say shuffle 1 .. 5'
41352
Run Code Online (Sandbox Code Playgroud)

每次都可重复.没有srand()调用它就不同了.