in reply to Re^3: Function over all letters in a string
in thread Function over all letters in a string
On that note one could alsoNo, not really. What happens if rand returns a value whose stringification only contains 0, 1 and 2? $r will be empty.# ... length $r or ($r = rand) =~ tr/3-9//cd; # ...
Besides, why are you caching the result of rand? Are you running out of random numbers? The overhead of a call to a user function (crand) is much higher than the overhead of a call to Perl primitive.
Abigail
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: Function over all letters in a string
by Aristotle (Chancellor) on Dec 01, 2003 at 18:11 UTC |