I have this perl score_board script that I use for a game. It shows the final result of a player. I’m trying to change the script in a way that the score board is immediately updated with the scores of the separate parts within the game.
To accomplish this I added $ref to each record which is a unique number. When the player finishes a part within the game all variables (incl. $ref) are sent to the script.
The idea is to match $ref with the specific field in the data file and update this record.
This is what I had in mind (replace the data of the specific record for the new data) but the script is aborted due to compilation errors:
$count=0;
foreach $data(@scores_data) {
$count++;
@datax=split(/\|/, $data);
if ($newref eq "@datax[0]" and $newref== "@datax[0]"
{
@scores_data[$count] = "$newref\|$part_1\|$part_2\|$total";
}
}
What is going wrong here?
Raoul,
[sig][/sig]
To accomplish this I added $ref to each record which is a unique number. When the player finishes a part within the game all variables (incl. $ref) are sent to the script.
The idea is to match $ref with the specific field in the data file and update this record.
This is what I had in mind (replace the data of the specific record for the new data) but the script is aborted due to compilation errors:
$count=0;
foreach $data(@scores_data) {
$count++;
@datax=split(/\|/, $data);
if ($newref eq "@datax[0]" and $newref== "@datax[0]"
@scores_data[$count] = "$newref\|$part_1\|$part_2\|$total";
}
}
What is going wrong here?
Raoul,
[sig][/sig]