Now you're using a flat file database - in the future you may want to convert that to a real database. My advice is to read the DBI perldocs by doing
perldoc DBI
at a command prompt. DBI is a database independent interface for accessing databases using Perl. If DBI looks promising (and even if it doesn't yet), then buy Tim Bunce's book "Programming the Perl DBI" - in there there is a section on flat file databases. Tim also describes the pro's and con's of using flat file databases. This is an excellent book for databases in general, but of course the majority of the book is devoted to proper use of the Perl DBI module and associated database specific DBD::<database> modules.
HTH.