Re: Other Globals in %once
Dave Rolsky <[email protected]>
| Newsgroups | gmane.comp.web.mason.devel |
|---|---|
| Message-ID | <[email protected]> |
On Wed, 28 Apr 2004, David Wheeler wrote: > Well, if $m was a global in %once, no one would have to do that. > Besides, it's clearly not just because you can access $m in %once that > there's a risk of things staying in scope a long time. I could do this: > > my $dt = DateTime->now; > > And I'd have a huge DateTime object in scope for a long time. Actually, it's only huge if you use an Olson time zone ;) > I suggest that the globals be allowed in %once, and that the > responsibility for not adding things to memory for too long a time (and > therefore for not creating what is effectively a memory leak) be left > to the Mason developer, where it already is, anyway. I can't even imagine what weirdness would happen if the Request object never went out of scope, since it includes references to the interp, apachehandler, and Apache request objects. Anyway, you can _use_ the globals inside the once section, because there's a "use vars" block at the top of the component. But if you wan to set them to something, that's up to you, I think. -dave /*======================= House Absolute Consulting www.houseabsolute.com =======================*/ ------------------------------------------------------- This SF.Net email is sponsored by: Oracle 10g Get certified on the hottest thing ever to hit the market... Oracle 10g. Take an Oracle 10g class now, and we'll give you the exam FREE. http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click