Stefan Johnson wrote:
> I know some people may complain and say I don't know what
> I'm talking about, but I read somewhere recently (while
> working on a dice function for my IRC bot) that "srand"
> is no longer necessary.

On the contrary, I'm sure you know what you're talking about
Stefan, and you're quite right. The 'rand' function in Perl
5.004 was changed so that, on its first call, it would call 'srand'
for you if you hadn't done so already.

> You might try removing that line from your code and see
> what errors you get (I doubt it will fix the problem, as it
> quit working before on a system that it used to work on)
> but it might generate an error.

I doubt if removing it would make any difference, but it
might be worth supplying it with a parameter. I don't know
where 'srand' gets its default seed from, but it does look as
though its always using the same one, which would then
produce the same sequence of random numbers thereafter.

Cheers,

Rob




-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to