Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Random letters

by plaid (Chaplain)
on Apr 12, 2000 at 04:10 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://7354]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (4)
As of 2024-04-19 14:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found