in reply to Random Text: There's got to be an easier way
I didn't use the dotdot in the list constructor, as you see. I think you could have written 'a'..'z' (that is, use the quotes) and not get the bareword warning. However, note that I leave out 'l' because it looks too much like a '1', and it should be somewhat human readable/reproducable, right?my $length= 6; #how many digits to generate my @letters= split (//, '0123456789abcdefghijkmnopqrstuvwxyz'); sub create_new_ID { my $result; foreach my $iteration (1..$length) { $result .= $letters[int(rand(scalar @letters))]; } return $result; }
—John
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
(boo)Re: Random Text: There's got to be an easier way
by boo_radley (Parson) on Jun 04, 2001 at 00:25 UTC |