It will all depend where the command is run, yes. The cleanest way to do it 
per-request is to use:

load_response ::request::response

Which will give you an array called response within your request namespace that 
automatically gets cleaned up after the request is served.

And, yes, load_response was originally thrown in as a compatibility command for 
NeoWebScript, but it really should have gone into the NWS compat library that 
we initially built. It’s still a nice convenience command, but given that it 
can sometimes create the array in confusing places (as seen here), it can be a 
little tricky.


> On Jun 17, 2015, at 4:52 PM, Massimo Manghi <mxman...@apache.org> wrote:
> 
> On 06/17/2015 10:29 PM, Paolo Bevilacqua wrote:
>> On Wed, Jun 17, 2015, at 04:43 PM, Damon Courtney wrote:
>>> I think we’ve found your problem. More information is always better. :)
>>> 
>>> parray prints the array contents directly, it DOES NOT return a value.
>>> So, if you’re logging this to a log file, you will see nothing from
>>> parray.
>>> 
>>> If you want to see what’s in an array, use
>>> 
>>> puts $log [array get response]
>>> 
>> 
>> Of course. I must have left brain in parking.
>> Interesting, load_response seems to keep adding data to the array, so
>> 'unset' is needed before calling Will work on that.
>> Thanks Damon!
>> <i>Always striving to honor my word and commitments</i>
> 
> if you're running your script as a .tcl file then variables are created by 
> default in the global namespace, therefore they survive after a request is 
> processed. Moreover load_response was originally designed (and modified) so 
> that it behaved like the same command in NeoWebScript, a Tcl based scripting 
> environment that partially spurred the creation of Rivet (Damon and David can 
> be more accurate on this)
> 
> I suggest you read the code in rivet/rivet-tcl/load_response.tcl, it's quite 
> simple
> 
> now, what is the output once you fixed your test script?
> 
> 
> -- Massimo
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: rivet-dev-unsubscr...@tcl.apache.org
> For additional commands, e-mail: rivet-dev-h...@tcl.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: rivet-dev-unsubscr...@tcl.apache.org
For additional commands, e-mail: rivet-dev-h...@tcl.apache.org

Reply via email to