Re: [q-lang-users] Avoiding trailing () in CGIs
Brought to you by:
agraef
From: <Dr....@t-...> - 2004-06-29 22:15:54
|
> The problem is, if I write something like this: > > | #!/usr/local/bin/q > | #! -q > | #! -s > | #! -p .: [list of directories] > | #! -cmain ARGS > [snip much programming] > | def PAGE=strcat [MimeType, cookies, "\n", BODY]; > | main ARGS = writes PAGE ; > > then obviously my webpage comes out with `()' on the bottom. This > invalidates the generated RSS stream or XHTML page. Solution: Either terminate your main function with something like `quit' or `exit 0' (i.e., main ARGS = writes PAGE || quit;), or add this to the -c line (e.g., #! -c main ARGS||quit). This causes the interpreter to exit before it prints the result expression. Hope this helps! > I'm playing around with Q for use as web CGIs - scripts build up XML data > and transform it with sablotron prior to printing it out. Interesting! I'm contemplating the idea to write an XML parser/unparser module for Q, but as I don't know much about XML I could use some assistance. Willing to help? Cheers, Albert -- Dr. Albert Gr"af Dept. of Music-Informatics, University of Mainz, Germany Email: Dr....@t-..., ag...@mu... WWW: http://www.musikwissenschaft.uni-mainz.de/~ag |