[boulder.pm] Persistant Data

Rob Nagler nagler at bivio.com
Tue Jul 18 00:32:17 CDT 2000


> it didn't work "out of the book" - is this an error on their part, then?

:)

>         I'm thinking more that I should not use the temp variable.  I
> think I was worried about either what would happen if the program died

You need to handle this case anyway.  The program (or computer) could
crash while the file is being written yielding partial results.  I would
recommend something like mySQL or Data::Dumper to a file.  The advantage
of Data::Dumper is that you either get all or none.  The disadavantage
is "speed".  Frankly, if the file is small, it is going to fit in a block
(4K in most Unix systems) and therefore it's a wash.

>         I was also of the understanding that tied hashes don't have the
> benefit of adding values if you assign to an undefined key.  

Don't know, but would make sense.  You probably don't want to do this.
Use "delete" instead.

> The only
> 'value' I'm getting out of the tied hash is a class reference, so do I
> still have that limitation within the class?

Can you persist class references?  Do you mean an instance of a class
or simply the class name (which is a string, not reference)?

Rob



More information about the Boulder-pm mailing list