To Reference or not to reference



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?

Don Dukelow
.



Relevant Pages

  • Re: To Reference or not to reference
    ... On 3/29/07, Dukelow, Don wrote: ... It has worked great until now when one sub program ... seams to be making its own copy of the hash. ... if you are finding your self writing code that ...
    (perl.beginners)
  • Re: To Reference or not to reference
    ... It has worked great until now when one sub program ... seams to be making its own copy of the hash. ... better to pass the global hash by reference to each sub program to cut ... I think pass by reference would be the better way to go. ...
    (perl.beginners)
  • Re: To Reference or not to reference
    ... If your basic data structure is a hash, ... sugar surrounding some simple data constructs? ... It has worked great until now when one sub program ... if you are finding your self writing code that ...
    (perl.beginners)