in reply to Re^2: Storable - File empties itself?
in thread Storable - File empties itself?

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

I rarely use Storable directly myself but yes it might well be an issue. I don't know the details of how Storable performs its I/O deep down but any time you might have two processes performing simultaneous I/O on the same file there is the possibility of catastrophic corruption. The very fact that the module offers functions like lock_store and lock_retrieve suggests that their use might be necessary on occasion.

just read in the documentation "The routine returns undef for I/O problems or other internal error, a true value otherwise. Serious errors are propagated as a die exception." so I'll add proper error checking now.

That seems like a worthwile action for sure.

Apache-Overview states Storable Version 2.56

I don't see that version listed anywhere but the 3.x releases started coming out in 2016 so you have a version which is quite old. It is at least worth bearing that in mind when reading newer documentation.


🦛

Replies are listed 'Best First'.
Re^4: Storable - File empties itself?
by feumw (Sexton) on Apr 13, 2023 at 11:47 UTC
    Unfortunately we're still running Solaris on this specific Server which makes everything about Perl-Modules a nightmare. This is the reason we're so behind on versions. So far, thank you for all your thoughts.

      > Unfortunately we're still running Solaris on this specific Server which makes everything about Perl-Modules a nightmare

      Does this mean you're using the Solaris-supplied version of Perl rather than building your own? I strongly agree with Fletch on this one:

      If you're doing anything serious with Perl you DO NOT want to use the OS' perl as that way lies much pain. Doing so couples you tightly to the OS' upgrade schedule for both the language and (if you're using its package manager for them) CPAN modules.

      -- Fletch in Re: Prefer Pure Perl Core Modules

      See also: Re: Replicate Perl setup (Building and Installing Perl References)

        As far as I know we're not using the system default perl. I don't know why but they still can't just use cpan to install modules. That's why they have a hard time managing this old server.

      AFAICT lock_store has been available since Storable 1.0.2 (with a potentially relevant bugfix in Storable 2.0).