You might also consider taking a peek at the DBI module on CPAN. As you probably know, SQL lets you sort the results of a SQL query using an ORDER BY clause. In keeping with the advice of not re-inventing the wheel, you can use this to shift the sorting burden from your code to a module that's already been written and (presumeably) thoroughly debugged.
Since DBI supports multiple database formats, this may help you as your application evolves. You're using a simple file format now, but you may wish to choose a different one later. For example, suppose you eventually need transactions, joining, and so on? If you start treating the application as a database, it'll be easier to add this type of support later.
Of course, it's possible to do the whole thing without using the module, but I've personally found it easier to use database engines earlier than later in an application's lifecycle--even if the application is one no one else will use. (Eventually, you want someone else to use it and....)
Just a thought for the future...
-- fIn reply to RE: Sorting on a particular field from a Flat File db??
by footpad
in thread Sorting on a particular field from a Flat File db??
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |