Observe the following:
if ($db_use_flock) {
flock(OPTIONS, 1);
}@lines = <OPTIONS>;close OPTIONS; LINE: foreach $line (@lines) {
$line =~ /^#/ and next LINE;
$line =~ /^\s*$/ and next LINE;
chomp $line;
@data = split (/|/, $line); $Name = $data[3];
$Email = $data[4];
$Phone = $data[5];
last LINE;
}
Then in my form I can use something like:
Your name is: $Name
Your email address is: $Email
etc.
I cannot get it to work. Am I missing something?
Basically I want to open a text file that is in pipe delimited format similar to the default db, split the values and use them as I showed above. If it helps, each text file database only has one record in it on one line.
Thanks in advance for any help. Ask me questions if you need to!
Code:
open (OPTIONS, ">/databases/$db_userid$in{'pw'}.txt"); if ($db_use_flock) {
flock(OPTIONS, 1);
}@lines = <OPTIONS>;close OPTIONS; LINE: foreach $line (@lines) {
$line =~ /^#/ and next LINE;
$line =~ /^\s*$/ and next LINE;
chomp $line;
@data = split (/|/, $line); $Name = $data[3];
$Email = $data[4];
$Phone = $data[5];
last LINE;
}
Then in my form I can use something like:
Your name is: $Name
Your email address is: $Email
etc.
I cannot get it to work. Am I missing something?
Basically I want to open a text file that is in pipe delimited format similar to the default db, split the values and use them as I showed above. If it helps, each text file database only has one record in it on one line.
Thanks in advance for any help. Ask me questions if you need to!