Random record access

Discussion in 'Perl Misc' started by Monty, Mar 13, 2007.

  1. Monty

    Monty Guest

    Is there a strategy in Perl to randomly access a file of variable-
    length records?

    Thanks
     
    Monty, Mar 13, 2007
    #1
    1. Advertising

  2. Monty

    Guest

    "Monty" <> wrote:
    > Is there a strategy in Perl to randomly access a file of variable-
    > length records?


    Many. "seek" and "tell". Tie::File (and many other Tie modules, I'm
    sure). All kinds of *DB* modules, like DB_File and DBM::Deep.

    And of course you could just slurp the file into an array or a hash,
    if it isn't too big.

    Xho

    --
    -------------------- http://NewsReader.Com/ --------------------
    Usenet Newsgroup Service $9.95/Month 30GB
     
    , Mar 13, 2007
    #2
    1. Advertising

  3. Monty

    Monty Guest

    The file could get big, so loading it up into memory probably isn't a
    good idea. I forgot to mention that it's a text file, so I wonder if
    that makes a difference. In the meantime I'll look into those
    possibilities you gave me.

    Thanks
     
    Monty, Mar 13, 2007
    #3
  4. Monty

    Monty Guest

    It appears that Tie::File is juuuuuust what I'm looking for!

    Thanks
     
    Monty, Mar 13, 2007
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?SnVzdGlu?=

    Retrieving Record Key while creating the record.

    =?Utf-8?B?SnVzdGlu?=, Oct 4, 2004, in forum: ASP .Net
    Replies:
    4
    Views:
    649
    =?Utf-8?B?SnVzdGlu?=
    Oct 5, 2004
  2. Kevin
    Replies:
    19
    Views:
    1,146
    Tris Orendorff
    Feb 13, 2006
  3. globalrev
    Replies:
    4
    Views:
    782
    Gabriel Genellina
    Apr 20, 2008
  4. Jamie Fryatt

    Random Record Selection from Access 2000

    Jamie Fryatt, Dec 4, 2003, in forum: ASP General
    Replies:
    2
    Views:
    104
    Aaron Bertrand - MVP
    Dec 4, 2003
  5. VK
    Replies:
    15
    Views:
    1,218
    Dr J R Stockton
    May 2, 2010
Loading...

Share This Page