Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

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

by Lotus1 (Chaplain)
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


Comment on Re^2: How to generate random sequence of UTF-8 characters
Select or Download Code
Replies are listed 'Best First'.
Re^3: How to generate random sequence of UTF-8 characters
by ted.byers (Scribe) 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?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (9)
As of 2015-07-08 00:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (93 votes), past polls