Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: Which is the better option?

by dree (Monsignor)
on May 18, 2002 at 13:11 UTC ( [id://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 :)

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (11)
As of 2024-04-18 16:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found