my $len=length($my_astr); $c1 = substr($my_astr, $p1 = int rand($len), 1); $c2 = substr($my_astr, $p2 = int rand($len), 1);