http://www.perlmonks.org?node_id=304638


in reply to Sainthood via Seniority Simulation

The logic is a little bit off in the while loop ;-)

If during the day, you advance to the next level, number of votes you can cast for that day is still based on your previous day's level.

However in your script, you do $level = $level->{next} first, and then right the way started to use $level->{votes}, which is the number of votes for the new level.

Not much difference in terms of the final results, especially take all the rand() into consideration, but the simulation is not precise.