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

Re (tilly) 2 (bug): An odd flat file database question

by tilly (Archbishop)
on Feb 08, 2001 at 07:29 UTC ( [id://57128]=note: print w/replies, xml ) Need Help??


in reply to Re: An odd flat file database question
in thread An odd flat file database question

See Re (tilly) 2: An odd flat file database question for an explanation of the bug in your code. In any case the problem is a data structure issue. Keeping a sorted list may be convenient for spitting data out, but is inconvenient when it comes to inserts and deletes. The simplest answer in this case is to use a BTree with DB_File setting the R_DUP flag on. You cannot get the features you need through the tied interface, but the OO interface gives you the ability to quickly access by catalog ID, insert and delete, and have duplicate entries.

Of course if the complexity of the problem grows a more sophisticated database would be a better fit...

  • Comment on Re (tilly) 2 (bug): An odd flat file database question

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (5)
As of 2024-09-20 13:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    The PerlMonks site front end has:





    Results (26 votes). Check out past polls.

    Notices?
    erzuuli‥ 🛈The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.