Sys-Mmap
view release on metacpan or search on metacpan
documented below.
When calling C<mmap()> or C<hardwire()> directly, you need to be careful how
you use the variable. Some programming constructs may create copies of a string
which, while unimportant for smallish strings, are far less welcome if you're
mapping in a file which is a few gigabytes big. If you use C<PROT_WRITE> and
attempt to write to the file via the variable you need to be even more careful.
One of the few ways in which you can safely write to the string in-place is by
using C<substr()> as an lvalue and ensuring that the part of the string that
you replace is exactly the same length. Other functions will allocate other
storage for the variable, and it will no longer overlay the mapped in file.
=over 4
=item Sys::Mmap->new( C<VARIABLE>, C<LENGTH>, C<OPTIONALFILENAME> )
Maps C<LENGTH> bytes of (the contents of) C<OPTIONALFILENAME> if
C<OPTIONALFILENAME> is provided, otherwise uses anonymous, shared inheritable
memory. This memory region is inherited by any C<fork()>ed children.
C<VARIABLE> will now refer to the contents of that file. Any change to
C<VARIABLE> will make an identical change to the file. If C<LENGTH> is zero
( run in 0.935 second using v1.01-cache-2.11-cpan-49f99fa48dc )