hi everyone,

i'm working on a search engine project and i am using my file system & text files as part of the search engine's database.

i have been using Tie::File to access these DB text files directly (if i understand correctly, using TIE does not pull the whole text file into memory, thus saving time & memory when working with really large files??)

i have also been using Compress::Zlib to compress large chunks of data to inside the DB text files ... each text file in our DB is stored as an array and looks like this:

numeric id | plain text data | zipped big chunk of data \n
numeric id | plain text data | zipped big chunk of data \n

i'm thinking this is useful because i can TIE to the file, pull any array element, then uncompress the zipped data to use.

now my question is two fold ...

1) is this a good srategy to manage large volumes of data or am i missing something?

2) i would also like to compress each DB text file (in addition to the already zipped chunks of data in each file), but i can't figure out how to TIE into the zipped file without pulling the whole text file into memory.

hope this makes sense ... needless to say, i'm a big fat newbie when it comes to PERL.

Shane

In reply to TIE:: to a compressed file ? by ShaneMetler

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.