Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: making loop in perl script

by talexb (Chancellor)
on Jan 23, 2004 at 21:22 UTC ( [id://323702]=note: print w/replies, xml ) Need Help??


in reply to making loop in perl script

It looks like you've posted some code that makes up passwords -- I haven't tried it -- and shown roughly how you call it. Your code fragment isn't complete -- I am guessing you have a list of users and want to create unique passwords for each user, but I can't tell.

Maybe you want to do something like this

my @users = qw/Albert Bob Charlie/; foreach my $thisUser ( @users ) { my $password = makePassword(); my $sql = "INSERT INTO login (login, password) VALUES (?,?)"; my $sth = $dbh->prepare($sql); $sth->execute($thisUser, $password); }

Alex / talexb / Toronto

Life is short: get busy!

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://323702]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (5)
As of 2025-06-12 16:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.