Re: interpoliation within regexp
- From: krahnj@xxxxxxxxx (John W. Krahn)
- Date: Thu, 28 Sep 2006 13:13:14 -0700
Derek B. Smith wrote:
--- "Mumia W." <mumia.w.18.spam+nospam@xxxxxxxxxxxxx>
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
.
- Follow-Ups:
- Re: interpoliation within regexp
- From: Derek B. Smith
- Re: interpoliation within regexp
- References:
- Re: interpoliation within regexp
- From: Derek B. Smith
- Re: interpoliation within regexp
- Prev by Date: Hash problem
- Next by Date: Re: --compare current date file with previous day
- Previous by thread: Re: interpoliation within regexp
- Next by thread: Re: interpoliation within regexp
- Index(es):