Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

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

by tobyink (Abbot)
on Dec 20, 2012 at 20:26 UTC ( #1009792=note: print w/ replies, xml ) Need Help??


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

Here's a string containing every Unicode word character (i.e. alphanumeric plus underscore) in a random order.

use List::Util 'shuffle'; my $all = join q[], grep /^\w$/, map chr, shuffle 0 .. 0x10FFFF;

Now split that up into parts of whatever length you like!

perl -E'sub Monkey::do{say$_,for@_,do{($monkey=[caller(0)]->[3])=~s{::}{ }and$monkey}}"Monkey say"->Monkey::do'


Comment on Re: How to generate random sequence of UTF-8 characters
Download Code
Replies are listed 'Best First'.
Re^2: How to generate random sequence of UTF-8 characters
by ted.byers (Scribe) on Dec 20, 2012 at 20:44 UTC

    Thanks. I will experiment with that.

    Thanks

    Ted

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (14)
As of 2015-07-30 13:28 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 (271 votes), past polls