We recently got cracked (ugh), and had the hosting service provider clean install a new OS (RH 7.2). I was to bring back our perl tools. We had perl5.00503 on our previous system, so this was partly a good thing... Now I was able to use a newer version. And so I started out upgrading perl (RH7.2 comes with 5.6.0 ), installing modules etc... Only, we seem to have this problem with our database files.

We have many databases, created by using perl's DB_File. When the upgrade happened and I tried to access the database to check on the data, I kept getting an undef from the result of tie()

So I boiled the problem down to this:

use DB_File; my %db; my $dbref = tie( %db, "DB_File", $filename ) || die $!;

The above dies with a "File exists" error. For the life of me, I don't understand why on earth this doesn't work...

Because of the error message, I tried using different flags for the fourth argument, like O_RDONLY, but that didn't help. I also checked that I have read/write permission....

I'm out of ideas now... any pointers are appreciated


In reply to (lestrrat) DB_File woes by lestrrat

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.