Getting started with storing a username, password and interest in a flat database

zaidmo used Ask the Experts™

I need to create a website that links to a perl script. The users on the website must enter a username password and there favourite interest groups. I need to know if I can store each field in an associative array (or another structure) and save the structure to the text file.

I am not sure which other way I can store the data. I do not want to store it as simple text, since users should be able to add or remove interests to their profile.
e.g. Username    Password   Interests
       John             abc             Soccer, Finance

Should I use an access database maybe?

Also, are there any websites on the net that I can view, that has Perl examples/resources on how to store web user details.
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Here are 2 scripts that might be of help:

Ms Access should only be used on Windows systems. In this case you should also better use ASP as scripting language. Otherwise use MySQL to store the data. But if there will be only a maximum of 200 users stored in a file /database then a flat file will be sufficient

Hi zaidmo,

I would Suggest making it sotre the information in a MySQL Database. MySQL runs on All Platforms
so have a look into that plus its easy to do perl scripts with MySQL
You can use any database like postgres, mysql if you are on linux for to connect to these databases you can use the module DBI, DBI has the separate module to connect with all these databases and you can simple execute your queries with these modules. But if the number of records are less then you should maintain these in the text file only because in the text file also you can modify and delete the records by loading the records into the associative array.
Tell me if you need some more resource for these.

Gourav Jain
Perl programmer, author and trainer
For what you're doing, storing the data in a tab separated file seems like the easiest option, particularly if you use Tie::File to access the various records in the file.


Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial