Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/leont/file-map
Memory mapping for Perl
https://github.com/leont/file-map
Last synced: 3 months ago
JSON representation
Memory mapping for Perl
- Host: GitHub
- URL: https://github.com/leont/file-map
- Owner: Leont
- Created: 2009-03-24T19:49:14.000Z (almost 16 years ago)
- Default Branch: master
- Last Pushed: 2023-04-11T22:44:02.000Z (almost 2 years ago)
- Last Synced: 2024-10-24T20:45:02.279Z (3 months ago)
- Language: Perl
- Homepage: http://search.cpan.org/~leont/File-Map/
- Size: 205 KB
- Stars: 15
- Watchers: 5
- Forks: 6
- Open Issues: 4
-
Metadata Files:
- Readme: README
- Changelog: Changes
Awesome Lists containing this project
README
File::Map
File::Map 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. File::Map 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
File::Map supports both Unix and Windows.Thread synchronization
It has built-in support for thread synchronization.INSTALLATION
To install this module, run the following commands:
perl Build.PL
./Build
./Build test
./Build installSUPPORT AND DOCUMENTATION
After installing, you can find documentation for this module with the
perldoc command.perldoc File::Map
You can also look for information at:
RT, CPAN's request tracker
http://rt.cpan.org/NoAuth/Bugs.html?Dist=File-MapAnnoCPAN, Annotated CPAN documentation
http://annocpan.org/dist/File-MapCPAN Ratings
http://cpanratings.perl.org/d/File-MapSearch CPAN
http://search.cpan.org/dist/File-MapCOPYRIGHT 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.