[boulder.pm] Persistant Data

Eric Shore Baur baur at frii.com
Tue Jul 18 00:14:47 CDT 2000


On Mon, 17 Jul 2000, Rob Nagler wrote:

> >     If I take out the "BEGIN" and "END" and just have those code blocks in the
> > main body of the script, it works perfectly, but it doesn't seem to work with
> > that code in those special blocks.  
> 
> I would guess that it would work with it in the END block, but not the
> BEGIN block.  BEGIN executes "first", before the rest of the code.
> 
	Yeah, I modified it right after sending out the question with only
the END block, and it does what I want.  I was still a bit surprised that
it didn't work "out of the book" - is this an error on their part, then?


> I'm sure there's even stranger stuff with tying variables.   We stay
> as far away from those as possible. :-)
> 
> Why not simply use a hash_ref that is always tied for the values instead
> of the intermediate variables?  Moreover, why not make a little wrapper
> object that managed the whole thing?
> 
	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
early, and I'm trying to speed up access to the data structure.  (I'm
trying to cut corners in some places, since I know other parts of the
process aren't very efficent. <grin>)
	I was also of the understanding that tied hashes don't have the
benefit of adding values if you assign to an undefined key.  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?

Eric




More information about the Boulder-pm mailing list