Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

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";
or
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 :)


Comment on Re: Which is the better option?
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://167500]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (14)
As of 2014-09-30 12:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (367 votes), past polls