in reply to Re: Search and replace text
in thread Search and replace text
Here are a couple of ways:
print join'',map{ chr 97+rand(6) } 1 .. 2 for 1 .. 100; ## Slightly wasteful, but you only do it once ## and reuse the array each time. my @pairs = grep{ /[a-f]{2}/ }'aa' .. 'ff'; print $pairs[ rand @pairs ];
|
|---|