in reply to Re: random number generation problem
in thread random number generation problem

thanks a lot for the code, but
return join ('', map { $vchars[int(rand($#vchars+1))] } 5 .. 5+int(rand(10)));
seems to also return strings less than 5 chars longs

Replies are listed 'Best First'.
Re: Re: Re: random number generation problem
by tadman (Prior) on Apr 27, 2001 at 01:49 UTC
    Would you believe it if I said that it should read:
    1 .. 5+int(rand(10)))
    Since we aren't counting from five to some number in the range of 5-15, but from 1!

    Thanks to cghost23 and Chmrr for the tip.