POSIX::RT::SharedMem
version 0.08
use POSIX::RT::SharedMem qw/shared_open/; shared_open my $map, '/some_file', '>+', size => 1024, perms => oct(777);
Map the shared memory object $name into $map. For portable use, a shared memory object should be identified by a name of the form '/somename'; that is, a string consisting of an initial slash, followed by one or more characters, none of which are slashes.
$name
$map
$mode determines the read/write mode. It works the same as in open and map_file.
$mode
Beyond that it can take three named arguments:
size
This determines the size of the map. If the map is map has writing permissions and the file is smaller than the given size it will be lengthened. Defaults to the length of the file and fails if it is zero. It is mandatory when using mode > or +>.
>
+>
perms
This determines the permissions with which the file is created (if $mode is '+>'). Default is 0600.
offset
This determines the offset in the file that is mapped. Default is 0.
flags
Extra flags that are used when opening the shared memory object (e.g. O_EXCL).
O_EXCL
It returns a filehandle that can be used to with stat, chmod, chown. You should not assume you can read or write directly from it.
Remove the shared memory object $name from the namespace. Note that while the shared memory object can't be opened anymore after this, it doesn't remove the contents until all processes have closed it.
File::Map
Leon Timmermans <leont@cpan.org>
This software is copyright (c) 2010 by Leon Timmermans.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install POSIX::RT::SharedMem, copy and paste the appropriate command in to your terminal.
cpanm
cpanm POSIX::RT::SharedMem
CPAN shell
perl -MCPAN -e shell install POSIX::RT::SharedMem
For more information on module installation, please visit the detailed CPAN module installation guide.