Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re^2: How to generate random sequence of UTF-8 characters

by Lotus1 (Curate)
on Dec 20, 2012 at 20:28 UTC ( #1009793=note: print w/replies, xml ) Need Help??


in reply to Re: How to generate random sequence of UTF-8 characters
in thread How to generate random sequence of UTF-8 characters

Here's another way:

my @chars = ( 0..9,'a'..'z','A'..'Z' ); print @chars; __DATA__ 0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ

update: And one more:

my $string = join '',0..9,'a'..'z'; $string =~ s/([a-z])/$1\u$1/g; print $string; __DATA__ 0123456789aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ

Replies are listed 'Best First'.
Re^3: How to generate random sequence of UTF-8 characters
by ted.byers (Monk) on Dec 20, 2012 at 20:38 UTC

    Thanks lotus and JohnGG. Both solutions are quite interesting.

    Thanks

    Ted

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1009793]
help
Chatterbox?
[Corion]: First World Problems - on my new desk, the sun shines in my face :)
[LanX]: damn sun ...blame Ophelia!
[choroba]: Yesterday, I gave Ramirez a headshot through the gate in Aztec. LOL. What happened to you? WTF? Sun. There was a hole in the window foil.

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (14)
As of 2017-10-18 13:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My fridge is mostly full of:

















    Results (245 votes). Check out past polls.

    Notices?