This might get a little fewer than the percentage requested because it's possible for it to pick the same position more than once. Try setting $percent = 90 for a good demonstration. I ran it ten times, and it never replaced more than 13/20 (well short of the expected 18/20).
In reply to Re^2: Finding a random position within a long string (Activeperl Build 822)
by kyle
in thread Finding a random position within a long string (Activeperl Build 822)
by mwah
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |