[ABE.pm] Tie::Hash-ing to files?

Faber J. Fedor faber at linuxnj.com
Tue Oct 17 11:54:18 PDT 2006


I've been going over the various docs wrt Tie::Hash and I don't get how
to do what I want to do.

Normally, when I want to add/delete lines from a text file, I Tie::File
the file and pop()/push() the data.

I've got three text files all with similar structure (each line consists
of "string, number\n").  My manipulations (in hash representation) are
along the lines of:

if ($moon_is_full) { deleteFromFile1($string); $file2{$string} = 0;}
if ($tide_is_high) { $file3{$string} = 3; }
etc.

What I would like to do is to load all three files into three separate
hashes and manipulate from there.  I *think* Tie:Hash will do that, but
am I right in thinking I have to write all of my own access methods?

I would have thought someone would have done this (load two-column data
from a file into a hash) already.


-- 
 
Regards,
 
Faber Fedor
President
Linux New Jersey, Inc.
908-320-0357
800-706-0701

http://www.linuxnj.com





More information about the ABE-pm mailing list