Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?

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 the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (7)
As of 2016-10-22 03:45 GMT
Find Nodes?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?

    Results (292 votes). Check out past polls.