-
randomize string in perl
- There are a few ways you could go about this. This one is terse but nice.
# in an executable file called "string-shuffle"
use List::Util 'shuffle';
print join('', shuffle( split //, shift) ), "\n";
- Then used from the command line like so:
apv@jasper[9]~/>string-shuffle "This is a string to shuffle."
hi.Tils t hsgsansefr ot fu i
-
-
[close]
Permanent link · http://querylog.com/q/randomize+string+in+perl
Suggested HTML for linking:
Link preview: randomize string in perl
-
09 July 2005
· Internet & computing
|