Can anyone help me?
Here is what I am trying to do:
open (DB, ">/databases/test.txt");
if ($db_use_flock) { flock(DB, 1); }
@data=<DB>;
close(DB);
foreach $line(@data) {
@ThisLine = split(/\|/,$line);
$Name = $ThisLine[2];
}
Example database format:
01|5|Joe Cool
I then call it using $Name.
Example: My name is $Name should print: My name is Joe Cool
However, I get nothing!
What am I doing wrong or what am I missing? This is driving me nuts and it is probably something simple!
By the way, for testing purposes, I have the databases directory and the test.txt permisssions set to 777, if that matters. Also, the database is only 1 line of delimited data.
Thanks!
Here is what I am trying to do:
open (DB, ">/databases/test.txt");
if ($db_use_flock) { flock(DB, 1); }
@data=<DB>;
close(DB);
foreach $line(@data) {
@ThisLine = split(/\|/,$line);
$Name = $ThisLine[2];
}
Example database format:
01|5|Joe Cool
I then call it using $Name.
Example: My name is $Name should print: My name is Joe Cool
However, I get nothing!
What am I doing wrong or what am I missing? This is driving me nuts and it is probably something simple!
By the way, for testing purposes, I have the databases directory and the test.txt permisssions set to 777, if that matters. Also, the database is only 1 line of delimited data.
Thanks!