Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Random letters

by plaid (Chaplain)
on Apr 12, 2000 at 04:10 UTC ( #7354=note: print w/replies, xml ) Need Help??


in reply to Random letters

The easiest way I can see to do it would be taking the random number you get and using it as an index into an array of letters. Something that looks like the following:
@letters = ('a'..'z'); # or ('A'..'Z') or ('a'..'z', 'A'..'Z'), etc +. $letter = $letters[ int rand scalar @letters ];
Which could be further condensed down if you only wanted to use this method once and wanted to make your code a little harder to read.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (2)
As of 2020-07-09 21:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?