Data::COW

Clone deep data structures copy-on-write
Download

Data::COW Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Luke Palmer
  • Publisher web site:
  • http://search.cpan.org/~lpalmer/

Data::COW Tags


Data::COW Description

Clone deep data structures copy-on-write Data::COW is a Perl module that makes copies of data structures copy-on-write, or "lazily". So if you have a data structure that takes up ten megs of memory, it doesn't take ten megs to copy it. Even if you change part of it, Data::COW only copies the parts that need to be copied in order to reflect the change.Data::COW exports one function: make_cow_ref. This takes a reference and returns a copy-on-write reference to it. If you don't want this in your namespace, and you want to use it as Data::COW::make_cow_ref, use the module like this: use Data::COW ();Data::COW won't be able to copy filehandles or glob references. But how do you change those anyway? It's also probably a bad idea to give it objects that refer to XS internal state without providing a value type interface. Also, don't use stringified references from this data structure: they're different each time you access them!SYNOPSIS use Data::COW; my $array = ; my $copy = make_cow_ref $array; push @$array, 3; # $copy-> is 3 push @$copy, 4; # $array-> is not defined (and doesn't even exist) # $copy is a real copy now push @$array, 5; # $copy is unaffected Requirements: · Perl


Data::COW Related Software