vendredi 8 avril 2022

Call srand only once when loading perl modules

My script is separated into multiple packages. main.pl loads A.pm, which loads A::B.pm and A::C.pm. They all use rand. However, if I specify a seed for srand in main.pl, the latter modules seem to generate their own seed anyway. How can I seed the RNG only once and have the entire script predictable?




Aucun commentaire:

Enregistrer un commentaire