in reply to Re: DB_file and DB_HASH
in thread DB_file and DB_HASH

BTREE is faster too, according to a benchmark posted here a while back.

Replies are listed 'Best First'.
Re: Re: Re: DB_file and DB_HASH
by krisraman (Novice) on Jun 05, 2002 at 01:23 UTC
    Thanks but my question is not to get the data in the sorted order but the order in which the data was inserted.For exam if I did 323|Val and 121|Val, I would like to get 323 first.Sorry if I confused.Is there any way to achieve this using BTREE,please advise

      Something like Storable or Freeze/Thaw might do what you want. Check the perldoc

      It sounds more like you're using it as an array then. Maybe you should use the Queue instead.

      If you need both insertion order access and random access by key you will have to store a separate array that keeps track of the order that keys were inserted.