in reply to Re^2: Storable and passed filehandles
in thread Storable and passed filehandles

Try the flock implemented by Storable first...
#!/opt/kalm/bin/perl -w use strict; use Storable qw(lock_store lock_retrieve); use Data::Dumper; $Data::Dumper::Deepcopy=1; $Data::Dumper::Purity=1; $Data::Dumper::Sortkeys=1; my %data = ( 1 => 'FEE', 2 => 'FYE', 3 => 'FOH', 4 => 'FUM', ); my $file = 'test.dat'; lock_store \%data, $file; my $hashref = lock_retrieve $file; print Dumper($hashref);

Replies are listed 'Best First'.
Re^4: Storable and passed filehandles
by blahblah (Friar) on Aug 15, 2005 at 23:33 UTC
    I had tried that, but it doesn't do what I need. It only locks the file during the actual read and write. It doesn't hold the lock to prevent other processes from changing the data while I do my thing.

    When we commit our changes we blast over each others changes.