Derek B. Smith wrote: > --- "Mumia W." <[EMAIL PROTECTED]> > wrote: >> >>What is the purpose of this program? > > To generate a random 6 character string. > > If the first character starts with a # then I just > ignore the new string and tell it to goto LABLE, b/c > for 0-32 on the ASCII table cannot be used as a 1st > character in a user password. > > ## generate random 8 char password. > PASSWD: my @a = ( 0 .. 9, 'a' .. 'z', 'A' .. 'Z'); > my $password = join '', map { $a[int rand @a] } 0 .. > 5;
Why not just specify a non-digit for the first character: my @a = ( 0 .. 9, 'a' .. 'z', 'A' .. 'Z'); my $password = join '', $a[ 10 + rand( @a - 10 ) ], map $a[ rand @a ], 1 .. 5; John -- Perl isn't a toolbox, but a small machine shop where you can special-order certain sorts of tools at low cost and in short order. -- Larry Wall -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>