Hi,
I have a small file called stats.txt and conatins the following:
username|gold|points|level|status|gender|email|pass|
Basically, when you run the script, it may looks like this. Let's say username is "Tom".
Tom|100|20|2|Alive|Male|host@email.com|secret
I've decided to save all this in one file to save my hosting space. Anyway, let's say i need to change the tom's gold which is 100 to 200. I know it could be done with overwriting but i don't know how to overwrite just one section. Here's a little half from my perl code:
open(F, "stats.txt"
;
@stats = <F>;
close(F);
foreach $stats (@stats)
{
chomp($stats);
($username ,$gold,$points,$level,$status,$gender,$email,$pass,$version)=split(/\|/,$stats);
}
I need to update one section but don't know how. Anyone have clue? Thanks again for reading this far.
I have a small file called stats.txt and conatins the following:
username|gold|points|level|status|gender|email|pass|
Basically, when you run the script, it may looks like this. Let's say username is "Tom".
Tom|100|20|2|Alive|Male|host@email.com|secret
I've decided to save all this in one file to save my hosting space. Anyway, let's say i need to change the tom's gold which is 100 to 200. I know it could be done with overwriting but i don't know how to overwrite just one section. Here's a little half from my perl code:
open(F, "stats.txt"

@stats = <F>;
close(F);
foreach $stats (@stats)
{
chomp($stats);
($username ,$gold,$points,$level,$status,$gender,$email,$pass,$version)=split(/\|/,$stats);
}
I need to update one section but don't know how. Anyone have clue? Thanks again for reading this far.