Hi all.

On Sat, Mar 08, 2003 at 08:03:11AM +0200, Octavian Rasnita wrote:
> I know how to create a random number, but could you tell me how can I create
> a random string that have numbers and letters?

I did it like this:

    my $stuff = '';
    for(1..100) { $stuff .= chr(int rand(96)+32); }

when I was playing with some code that needed to generate a browser id
to store in a cookie.  I stored just a hash of the above (and some
other stuff) in the cookie. 

There's probably better ways but that worked for me.  Hope it helps you.



Garrick.
-- 
It is easier to denature plutonium than to denature the evil spirit of man.
Albert Einstein (1879-1955)

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

Reply via email to