Re: To Reference or not to reference



Hi

On 29 Mar 2007 at 12:51, Dukelow, Don wrote:

I've written a Perl program that declares a hash at the top of the
program "%myHask;". It has worked great until now when one sub program
seams to be making its own copy of the hash. I can find no typo's or
anything but there my still be one there. My question is would it be
better to pass the global hash by reference to each sub program to cut
down on possible typo errors or just leave it global and fix the problem
I have?


I think pass by reference would be the better way to go. It will
conserve memory as your not passing all the data around and it will
ultimately make maintenance easier.

Good luck,
Dp.



.