NAME Tie::HashArray - Allows arays to be stored inside a hash. SYNOPSIS use Tie::CmplxHash; tie %newhash, \%oldhash [, CACHE_SIZE]; # Create the new hash object. $newhash{key} = $arrayref; # Store the array into the hash. $arrayref = $newhash{key}; # Get the array from the hash. REQUIRES Perl 5.004, Storable, Carp DESCRIPTION This module uses the Storable module to serialize/deserialize data and store/fetch it from the original hash. All operations are performed on references. This means that the original hash can be any hash (DBM, regular hash or even another Tie module). It also means that it can store not only arrays but anything you want (though if you need to store anything much more complex than an array I sugest finding a better solution). The main intent for this module is to store more complex data structures into DBM files. DBM's are wonderful for small to medium amounts of data. But when complex data structures are needed it can get hairy. And there are times when a RDBMS is just a little much. So this module extends the middle ground that DBM files cover just a little bit more. CACHE Yes you heard me right, cache. I have implemented a small, no frills, cache to speed things up a little. When working with large data structures or just a lot of data things can get a little slow. So if CACH_SIZE is specified caching is turned on and the last CACHE_SIZE keys that are accessed are kept in memory. All that is actually stored is te reference. This will keep Perls garbage collector from freeing that memory (at least I hope it alwayse works that way) so it stays available. When deciding wether to use cachin or not keep in mind that caching can actually do more harm than good. It all depends on how you use the data. If you do more reads than writes caching may help. But if you do more writes than reads it will definitely harm you. Play with CACHE_SIZE and see what results you get. WARNING DO NOT MODIFY THE ORIGINAL HASH. Unless you know what you are doing, once you start using this module on a hash DO NOT touch it directly. In fact only use this module on a brand new fresh hash. All kinds of nasty stuff could occure. Stuff that I don't know how or fell like checking for. This is not a end all do all module, it is a tool. If used properly it can help out a lot, just like any other tool. And if use improperly it can cause BIG headaches, just like any other tool. As mentioned in the code and below. There is no waranty at all. I am not responsable for what you do with this tool. If important data is destroyed it's your problem, not mine. I warned you. INSTALLATION The same as all CPAN modules. perl Makefile.PL make make test make install AUTHOR Lorance Stinson, lorance@madlinux.cx COPYRIGHT and LISCENSE ########################################################## # Copyright (c) 2000 Lorance Stinson lorance@madlinux.cx # # All rights reserved! No warranty! Use at your own risk!# # This program is free software; you can redistribute it # # and/or modify it under the same terms as Perl itself. # ########################################################## SEE ALSO perl(1). perlref(1). perlreftut(1).