atom feed7 messages in org.apache.tcl.rivet-devRe: globals
FromSent OnAttachments
Massimo ManghiApr 7, 2006 9:59 am 
David N. WeltonApr 8, 2006 4:00 am 
Massimo ManghiApr 8, 2006 7:09 am 
David N. WeltonApr 9, 2006 12:33 pm 
Massimo ManghiApr 9, 2006 2:59 pm 
David N. WeltonApr 10, 2006 2:51 pm 
Massimo ManghiApr 10, 2006 4:12 pm 
Subject:Re: globals
From:David N. Welton (dav@dedasys.com)
Date:Apr 8, 2006 4:00:39 am
List:org.apache.tcl.rivet-dev

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/