>> Firstly it is not using locking > Yeah, that's right. Might this be an issue? I've never worked with this Module before.

It's not really a question about this module. You have a file, and (on every page request?) you read the file, and write completely new data overtop the old file. Assuming this happens in a web controller, all you need is two users to simultaneously load a page and their controllers will be simultaneously overwriting the file. Only one update will win, and if the perfect timing happens of one controller clearing the file to begin writing it while the other controller has just started reading it, you end up with an empty file.

There are dozens of database-in-a-file options to choose from here (and DB_File is a core perl module), but since it looks like all you want are a user ID and a timestamp, you could even just create a directory and "touch" an empty file per user id.


In reply to Re^3: Storable - File empties itself? by NERDVANA
in thread Storable - File empties itself? by feumw

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.