Sys::Mmap::Simple

Sys::Mmap::Simple is a module that maps files or anonymous memory into perl variables.

Advantages of memory mapping
  *   Unlike normal perl variables, mapped memory is shared between
      threads or forked processes.

  *   It is an efficient way to slurp an entire file. Unlike for example
      File::Slurp, this module returns almost immediately, loading the
      pages lazily on access. This means you only 'pay' for the parts of
      the file you actually use.

  *   Perl normally never returns memory to the system while running,
      mapped memory can be returned.

Advantages of this module over other similar modules
 Safety and Speed
  This module is safe yet fast. Alternatives are either fast but can cause
  segfaults or loose the mapping when not used correctly, or are safe but
  rather slow. Sys::Mmap::Simple is as fast as a normal string yet safe.

 Simplicity
  It offers a more simple interface targeted at common usage patterns

  *   Files are mapped into a variable that can be read just like any
      other variable, and it can be written to using standard Perl
      techniques such as regexps and "substr".

  *   Files can be mapped using a set of simple functions. No weird
      constants or 6 argument functions.

  *   It will automatically unmap the file when the scalar gets destroyed.
      This works correctly even in multithreaded programs.

 Portability
  Sys::Mmap::Simple supports both Unix and Windows.

 Thread synchronization
  It has built-in support for thread synchronization.

This is an early release. There are likely to be bugs. Also I can't guarantee API stability yet.

INSTALLATION

To install this module, run the following commands:

	perl Build.PL
	./Build
	./Build test
	./Build install

SUPPORT AND DOCUMENTATION

After installing, you can find documentation for this module with the
perldoc command.

    perldoc Sys::Mmap::Simple

You can also look for information at:

    RT, CPAN's request tracker
        http://rt.cpan.org/NoAuth/Bugs.html?Dist=Sys-Mmap-Simple

    AnnoCPAN, Annotated CPAN documentation
        http://annocpan.org/dist/Sys-Mmap-Simple

    CPAN Ratings
        http://cpanratings.perl.org/d/Sys-Mmap-Simple

    Search CPAN
        http://search.cpan.org/dist/Sys-Mmap-Simple


COPYRIGHT AND LICENCE

Copyright (C) 2008 Leon Timmermans

This program is free software; you can redistribute it and/or modify it
under the same terms as Perl itself.

