[Israel.pm] tie

Shlomo Yona shlomo at cs.haifa.ac.il
Tue Jun 15 07:17:43 PDT 2004


Hello,

I have a list of lists (LoL), which is a list of binary
vectors.

.1.

I'd like to have this list of vectos tied to a file.
That's easy:

	tie @list_of_vectors, 'Tie::File', $vectors_list_filename;

BUT -- the vectors themselves must now be represented as
strings... and I cannot look up in them, I cannot do
operations on them unless I split the "line" before usage
and then join the "vector" back to a "line" after doing my
stuff.

I wonder if there's a way to allow a LoL to be tied nicely
to a file, so that the usage is just like using a LoL but in
fact the data is tied to a file, rather than being all in
memory.

.2.

To make things more complicated: What if I wanted to have
the vectors be sparse-vectors, but still keep the simple LoL
usage instead of all the extra hassle which is now required
to handle the tied list and the sparse vector.....?



Are there ready made solutions for this? How?



-- 
Shlomo Yona
shlomo at cs.haifa.ac.il
http://cs.haifa.ac.il/~shlomo/



More information about the Perl mailing list