# ... length $r or ($r = rand) =~ tr/3-9//cd; # ... s[(.)]{$1 x crand/3}ge;