I'm gonna write a forum in Perl, and I just wondered the best way to store the member details. I didn't want to read through each member file just to load their "number of posts" or something each time someone views a topic, so I thought about using hashes, eg:
Obviously with more stuff in though.
Is this stupid? I thought maybe it would take a lot of memory if the number of members got quite big.
What's the best way? I don't want to use a database like MySQL, I'd rather use flat files (for those that don't have databases, and so it's still efficient for small forums)
I'd be very grateful of any suggestions.
Thanks,
Danny
Code:
$users = {
"Danny" => {
name => "Danny Tuppeny",
email => "Danny\@MyBest50.com",
age => "17",
},
"John" => {
name => "John Edwards",
email => "John\@Johnnyboy.com",
age => "127",
},
};
Obviously with more stuff in though.
Is this stupid? I thought maybe it would take a lot of memory if the number of members got quite big.
What's the best way? I don't want to use a database like MySQL, I'd rather use flat files (for those that don't have databases, and so it's still efficient for small forums)
I'd be very grateful of any suggestions.
Thanks,
Danny