in reply to generate random number without using any built in function in perl?
Search for pseudo random number generator, there are lots of explanations on the Internet already.