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

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

Replies are listed 'Best First'.
Re: Re: Re: Re: DB_file and DB_HASH
by jreades (Friar) on Jun 05, 2002 at 01:48 UTC

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

Re: Re: Re: Re: DB_file and DB_HASH
by perrin (Chancellor) on Jun 05, 2002 at 03:32 UTC
    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.