Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?

Re^3: Storable and passed filehandles

by Roger (Parson)
on Aug 15, 2005 at 23:26 UTC ( #484022=note: print w/replies, xml ) Need Help??

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.

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://484022]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (6)
As of 2022-11-29 22:21 GMT
Find Nodes?
    Voting Booth?