On May 5, Jos I Boumans said:

> for (0..int(rand(4) + 4)) {
>  $_ = int(rand(2));
>  if (/0/) {
>   $string .= $letters[rand(26)];
>  } else {
>   $string .= int(rand(10));
>  }
> } #for

This is a silly use of a regex -- it's rather wasteful.  Just use:

  if (int rand 2) {
    $string .= int rand 10;
  }
  else {
    $string .= $letters[rand 26];
  }

-- 
Jeff "japhy" Pinyan      [EMAIL PROTECTED]      http://www.pobox.com/~japhy/
Are you a Monk?  http://www.perlmonks.com/     http://forums.perlguru.com/
Perl Programmer at RiskMetrics Group, Inc.     http://www.riskmetrics.com/
Acacia Fraternity, Rensselaer Chapter.         Brother #734

Reply via email to