CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner:
get multiple user/passes from one .txt file?

 



ultimategamer2k
User

Feb 16, 2001, 1:16 PM

Post #1 of 2 (263 views)
get multiple user/passes from one .txt file? Can't Post

whats the code to get multiple user/passes from one text file?
------------------- .txt file -------------------------------------
user1:pass1
user2:pass2
user3:pass3
etc
----------------/ .txt file ----------------------------
the codes something like this.. but what else does it need to have?

----------------- cgi code----------------------------
foreach $pair (@pairs) {
($user, $pass) = split(tr/:/ /);
}
print "$name, $value";
close FILE
--------------------- /cgi code --------------------------------
so what do i need to change??????

visit my web site at http://ultimategamer.cjb.net


muinatit
Deleted

Feb 16, 2001, 1:23 PM

Post #2 of 2 (262 views)
Re: get multiple user/passes from one .txt file? [In reply to] Can't Post


Code
open USR, 'users.txt' or die $!; 
while (<USR>) {
($user[$.], $pass[$.]) = split (/:/, $_);
}
close USR;
print "Users: @user - Passwords: @pass";

Jeffrey "muinatit" Lamoureux
muinatit@hotpop.com

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives