Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid

Re: Which is the better option?

by dree (Monsignor)
on May 18, 2002 at 13:11 UTC ( #167500=note: print w/replies, xml ) Need Help??

in reply to Which is the better option?

Both CSV and XML are good options. For good disk access you can use DB_File: you can tie an hash on disk. You can use the student's name as key to fast access the record:
$student_hash{$name}=...CSV structure here...
Also you can manage duplicate keys. So the code to tie is:
use DB_File; tie %DB_IT, "DB_File", "$filename1", O_CREAT|O_RDWR, 0666 or die "Can' +t open $filename1: $!\n";
use DB_File; $DB_BTREE->{'flags'}= R_DUP; tie %D1, "DB_File", "filename2", O_CREAT|O_RDWR, 0666, $DB_BTREE or di +e "Can't open $filename2: $!\n";
for duplicate keys.

Update: changed CVS in CSV :)

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://167500]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (4)
As of 2017-06-29 14:43 GMT
Find Nodes?
    Voting Booth?
    How many monitors do you use while coding?

    Results (671 votes). Check out past polls.