Tie::DB_Lock

Tie::DB_Lock Perl module can ties hashes to databases using shared and exclusive locks.
Download

Tie::DB_Lock Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Ken Williams
  • Publisher web site:
  • http://search.cpan.org/~kwilliams/Module-Build-0.2808/lib/Module/Build/Compat.pm

Tie::DB_Lock Tags


Tie::DB_Lock Description

Tie::DB_Lock Perl module can ties hashes to databases using shared and exclusive locks. Tie::DB_Lock Perl module can tie hashes to databases using shared and exclusive locks.SYNOPSIS use Tie::DB_Lock; use DB_File; tie(%hash, 'Tie::DB_Lock', $filename, 'rw'); # Open for writing $hash{'key'} = 'value'; untie %hash; tie(%hash2, 'Tie::DB_Lock', $filename); # Default is read-only print("Value is $hash2{'key'}n"); untie %hash;This is a front-end for the DB_File package.If you tie a hash in read-only mode, this module puts a shared lock on the database file, copies it to a temporary file, unlocks the original database, and then ties the tempfile using DB_File.If you tie the hash in read-write mode, we put an exclusive lock on the database and tie it directly using DB_File.The reason I copy the whole file every time I read from it is that this allows the program to read from the file for as long as it wants to, without interfering with other people's writes. This works well if you typically have long, sustained reads, and short, bursty writes. See the README file for help in deciding whether you want to use this package.You don't always need to call untie() explicitly - it will be called for you when %hash goes out of scope. And if all goes as planned, you'll never know the temporary file ever existed, since it will evaporate when %hash goes away.Requirements:· Perl


Tie::DB_Lock Related Software