Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

(ar0n) Re: Randomise a string of letters

by ar0n (Priest)
on Jan 15, 2003 at 14:35 UTC ( #227153=note: print w/ replies, xml ) Need Help??


in reply to Randomise a string of letters

use Algorithm::Numerical::Shuffle qw/shuffle/; my $random = join '', shuffle split //, "The quick brown fox";
Though "truly random" is often a bit of a misnomer in computer land.


Comment on (ar0n) Re: Randomise a string of letters
Download Code
Replies are listed 'Best First'.
Re: Re: Randomise a string of letters
by Hofmator (Curate) on Jan 16, 2003 at 08:24 UTC
    or use List::Util qw/shuffle/; (rest stays the same) which has the added bonus of coming standard with perl 5.8.0.

    -- Hofmator

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (14)
As of 2015-07-29 18:38 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 (267 votes), past polls