PDA

View Full Version : need help with Perl


kevin
09-04-2000, 02:16 AM
Hello all, I'm hoping someone can assist me with a snippet of PERL code or point me in the right direction. The problem consists of editing an element in a single line of text stored in a file. An example line would look like this:<BLOCKQUOTE><font size="1" face="Verdana, Arial">code:</font><HR><pre>
bozo@e-pixs.com|bozo|hat|yes|08/30/00|18:51:46(PDT)|209.178.135.96|Mozilla/4.0 (compatible; MSIE 5.0; MSN 2.6; Windows 95; DigExt)
[/code]
the third element is a password "hat". I would like users to be able to change the password using a form. Their email address will be used to identify the correct line to work with, but how to change the third part of the array (|hat|) only? The file will contain many lines similar to the above line. The elements are seperated by a pipe (|) and the end of each line uses \n. Thanks for any responses. Kevin

Titan
09-06-2000, 07:14 PM
$form{'email'} = ($form{'email'});
$form{'bozo'} = ($form{'bozo'});
$form{'hat'} = $hat_field if !($form{'hat'});

you need to make sure that your dat file is opened and closed and possibly file locked if sharing is a possibility...

each form line will be de-limited and adding if statements to each changeable field...

PS...Just repost to the topic you need help with it'll bumb it to the top...no need to start another thread ;)




------------------
Best of Luck!

Titan
ICQ 37149892

kevin
09-07-2000, 05:04 PM
Titan,

Thanks for the response. I will give it a try.

Kevin

Isaac
09-08-2000, 07:29 AM
You may want to take a look at www.perlaccess.com (http://www.perlaccess.com) and www.cgidir.com (http://www.cgidir.com) for more info on learning perl. Also remember that you can contact me via ICQ if you have question or if you need some help. ;)

I'm sorry that we didn't answer you post in a more timely maner. I somhow must have missed it. :(



------------------
Isaac
Big Resources Inc. (http://www.bigresources.com)
Big Resource Network
isaac@123webmaster.net
ICQ# 71401549