Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: randomly generating A-Za-z

by pjf (Curate)
on Oct 12, 2001 at 06:49 UTC ( [id://118402]=note: print w/replies, xml ) Need Help??


in reply to randomly generating A-Za-z

G'day princepawn,

dws noted the problem with your code above, with those pesky characters in between. You might find the following snippet useful.

use constant (randchars => join("",'a'..'z','A'..'Z')); use constant (randchars_len => length(randchars)); sub letter { return substr(randchars,int(rand(randchars_len))); }
Of course, TMTOWTDI. The above code uses constant strings to maximize speed.

Cheers,
Paul

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://118402]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (6)
As of 2024-04-18 13:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found