I have an urgent need for a module to tie an array of integers to an
mmap'ed file (a sparse array of several hundred million integers). I
have looked at Mmap.pm by Malcolm Beattie and seen the idea for
Array::Virtual registered by Larry Wall and have started implementing
the module I need. But should it be called Array::Virtual (taking
Larry's slot) or Mmap::Array?
The interface I have in mind is:
use Array::Virtual; # or Mmap::Array
my @array;
open(FH, "...");
my $nel = 42;
my $prot = "rw"; # or "ro", or "wo" or should it be PROT_READ?
my $shared = 1; # or should it be MAP_SHARED?
my $offset = 0; # this would be the default anyway
my $type = "int4" # some set of (string) literals for 1, 2, 4, 8
# byte integers in native or network byte
# order, plus floating point (default probably int4)
tie @array, $nel, $prot, $shared, FH, $offset, $type;
$array[0] = 42;
#etc
undef @array;
Any thoughts?
Andrew
--
Andrew Ford, Director Ford & Mason Ltd +44 1531 829900 (tel)
[EMAIL PROTECTED] South Wing, Compton House +44 1531 829901 (fax)
http://www.ford-mason.co.uk Compton Green, Redmarley +44 385 258278 (mobile)
http://www.refcards.com Gloucester, GL19 3JB, UK