
Borderline
Deleted
Jan 25, 2000, 9:12 AM
Post #2 of 3
(1556 views)
|
If you need this much control on the sorting of the information in your text file I recommend you move the information to a Database. You can use a local Database with the module DB_File if you do not have access to an SQL server. This will make your life a lot easier. Quick example of using DB_File <BLOCKQUOTE><font size="1" face="Arial,Helvetica,sans serif">code:</font><HR> #!/usr/bin/perl -w use strict; use DB_File; my @data; tie @data, 'DB_File', 'file.db', O_CREAT|O_RDWR, 0666, $DB_RECNO or die 'Could not tie file.db: $!'; $data[0] = 'john|doe|30|male'; $data[1] = 'jane|doe|29|female'; untie @data; </pre><HR></BLOCKQUOTE> Now all the data is stored in a database named file.db.To access the info you just tie anouther array to the file. Remember what ever you do to the array will be done to the file. See perldoc DB_File for more info. HTH Scott
|