On Fri, Mar 14, 2003 at 11:49:47AM -0500, Jeremy Cowgar wrote:
> I placed this file in server/modules/tcl/hello.tcl
>
> set hello "Hello %s"
>
> ns_register_proc GET /hello howdy
> proc howdy {conn context} {
>     global hello
>     ns_return [format $hello "Jeremy"]
> }

> [14/Mar/2003:11:16:20][17125.65541][-conn:server1::0] Error: can't read
> "hello": no such variable

Yes, you need to read the docs:

  http://aolserver.com/docs/devel/tcl/
  http://aolserver.com/docs/devel/tcl/tcl-general.html

Well, hm, those oldish docs aren't quite as clear as they could be.
But anyway, the main point is:

Tcl globals are per-thread in AOLserver, NOT server wide.  If you need
a server-wide variable, use nsv instead.

Don't feel too bad, this is a very typical mistake for people to make
when new to AOLserver, until they read and remember the docs on how
the basics of multi-threaded Tcl in AOLserver works.  :)

--
Andrew Piskorski <[EMAIL PROTECTED]>
http://www.piskorski.com



I. To remove yourself from this list:

Send a message to "[EMAIL PROTECTED]"  with the following text in
the BODY of your message:

signoff aolserver

II. For a complete list of listserv options please visit:

http://listserv.aol.com/

III. For more AOLserver information please visit:

http://www.aolserver.com/

Reply via email to