[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

[MacPerl] Random behavior



I'm using MacPERL to develop some PERL scripts which are eventually uploard
to a UNIX web server. I've noticed some odd behavior in the rand() function
between the two platforms.

IN MacPERL, I was able to user rand() to create a random number without
first using srand() to seed the random numbers. Everything worked fine
until I uploaded it onto the web server. Unix requires srand() first,
otherwise I get the same number every time. But when I added srand() to my
Mac version, it no longer worked, giving me the same number every time.

Has anyone else experienced this? Why is it happening?

-----------
Peter Pinch
Harvard University