Re: [PATCH 12/18] gitweb: Change file handles (in caching) to lexical variables as opposed to globs
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Dec 10, 2010, 00:32 UTC
- Message-ID
- <7vwrnieac8.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <m3d3pa1o0j.fsf@localhost.localdomain>
Jakub Narebski <jnareb@gmail.com> writes:
Show 10 quoted lines
>> +# Global declarations >> +our $cacheFile; >> +our $cacheFileBG; >> +our $cacheFileBinWT; >> +our $cacheFileBin; > > You are trading globs for global (well, package) variables. They are > not lexical filehandles... though I'm not sure if it would be possible > without restructuring code; note that if variable holding filehandle > falls out of scope, then file would be automatically closed.
Hmm. why is it a bad idea, when you need to access these from practically everywhere, to use global variables to begin with? To a certain degree, it sounds like an unnecessary burden without much gain to me.