Re: script attack



Eric Schwartz wrote:

> Brian Wakem <no@xxxxxxxxx> writes:
>> 'local our' is common use in mod_perl.
>>
>> http://perl.apache.org/docs/1.0/guide/porting.html#The_First_Mystery
>
> Okay, fair enough; all the mod_perl I've done has been with Mason,
> which hides all that with the MasonAllowGlobals Apache directive.
> Even so, I look at those examples, and think, "You know, if they just
> passed variables around, instead of using globals, they wouldn't need
> 'local our' at all."


Yes it's best put to use when porting a load of existing mod_cgi scripts to
mod_perl. Wacking a load of 'local our's in can save hours, and time is
money.

Even so, a global my (and many scripts will have one) will not be shared
correctly between subs, so you use our, but in mod_perl it will hold on to
the memory it used after the script has finished. local our therefore
helps keep memory usage down.



--
Brian Wakem
Email: http://homepage.ntlworld.com/b.wakem/myemail.png
.



Relevant Pages

  • Re: PHP Dynamic Form Generator
    ... I'm currently reviewing a load of scripts to dynamically generate a form ... I have designed a registration form, and once registered and logged in ... I just wanted to ask everyone for any advice on this and which scripts you ... PHP Classes - Free ready to use OOP components written in PHP ...
    (php.general)
  • Re: requireing globals without used only once complaints from perl -w?
    ... The only "solution" I've seen is to make sure all globals are referenced ... My situation is a project of cgi-bin scripts, ... all wanting to load global settings from a single 'config.pl' file. ... use strict; ...
    (comp.lang.perl.misc)
  • Re: Newbie - Variable Scope
    ... >def modfunc(): ... I think this is technically one script (not "two scripts"), ... 'testmod' and y is '*') which shouldn't be used for your own modules unless you ... I would put the globals in a third module and have everything ...
    (comp.lang.python)
  • Re: inserting random photo with caption
    ... > carolyn wrote: ... >> I am looking for a script that can load a random photo or other graphic ... The trick is that I would also like it to load a related ... >> I have found lots of scripts that will load random photos, ...
    (alt.html)
  • Re: "use" inside of a subroutine
    ... variables that are used in all of my scripts. ... to load a module at compile time, ... something else which uses a persistent Perl interpreter. ...
    (comp.lang.perl.misc)