Massimo Manghi wrote:
> Hi, I have a problem trying to correctly understand the docs
> in the section where the ::request::global is explained (Internals).

> The question  (attempt to preserve functioning tcl scripts
> when they are "cut'n'pasted" into rivet pages) is put in a
> way that (seems to me) it warns the developer that "global" is meant
> for persistence whereas the ::request::global command is for making
> into Rivet traditional "global scope" variables.
> (I don't see any other possible reason for bringing up the problem
> in the documentation). Am I misunderstanding the whole stuff?
> I wrote a sample script using  ::request::global, global, ::global in turn
> trying to have persistence, but obtained only variables that are created
> every time I reload the page.

Remember that they are persistent *within the particular instance of
Apache* - and since Apache usually runs with several child processes,
you can't count on something like a counter working reliably.

> <?
>    global visits #or ::request::global visits or ::global visits
> 
>    set visits([clock seconds]) [env REMOTE_ADDR]
>    foreach {t ip} [array get vists] {
>       puts "-> $t $ip <br  />"
>    }
> ?>
> 
> My comprehension of the docs is maybe unadequate, but
> I suggest to reformulate the paragraph in a more schematic
> form.

Such as...?  Want to have a try?:-)

-- 
David N. Welton
- http://www.dedasys.com/davidw/

Linux, Open Source Consulting
- http://www.dedasys.com/


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to