in reply to Re: Finding a random position within a long string (Activeperl Build 822)
in thread Finding a random position within a long string (Activeperl Build 822)
Sth. like this is the approach I initially took (and failed).my $percent = 10; my $string = 'A' x 1_000_000; for ( 1 .. $percent / 100 * length $string ) { my $pos = int rand length $string; substr( $string, $pos, 1 ) = '?'; } print $string =~ y/?//;
In Activeperl/Win, the RAND_MAX of the underlying clib is promoted into perl?Is this documented?
|
|---|