Dear Monks,

I'm writing a small ajax responder that will need to drop into a webserver which I have absolutly no control over (no shell access), is a different architecture (Solaris on a sparc) than I develop with, and has a very default perl install. Execution under CGI does not allow me to write to a file.

I've got a very simple data requirement. I need indexed access to a specific row (not range) of data. I've got 50,000 rows of simple, small text data with a small (3-5 character) text key. The data never changes except when I want to upload a new data file.

I built a nice little application using DB_File (DB_HASH). I created the hash.db on my Linux x86_64 box and uploaded it along with a perl cgi to the sparc. It didn't work :(. I'm not sure why, either it isn't binary portable or the spark has a funky berkeley db.

Is there a native perl implementation of DB_File? Is there a way to create a more generic Berkeley hash file? Should I look towards other packages such as MLDBM? Should I go with something huge like sqlite? Should I write my own file structure and b-tree?

Further complicating my choices is the fact that my client is a mere pawn in an enourmous government burocracy and had to grovel just to get execute permissions for cgi. I had to painfully guide him through ftp chmod 0755 to even get the script to run. I need a solution that is guaranteed (or just likely) to work under any environment.

Any help is welcome!


In reply to Super-Portable DB_File Solution by rokadave

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.