go ahead... be a heretic | |
PerlMonks |
Re: How much random is rand()?by merlyn (Sage) |
on Jan 19, 2009 at 18:17 UTC ( [id://737364]=note: print w/replies, xml ) | Need Help?? |
What do you think scalar grep /4/, qw(14) returns?
Yup. The moment you add 14, you can't ever add 4, because it's a subset of 14. So you get "stuck" adding the last few single-digit numbers, because they're already "within" the longer numbers. You should be looking for shuffle instead. Been done quite a few times here already. For the lazy:
In Section
Seekers of Perl Wisdom
|
|