[q-lang-users] Avoiding trailing () in CGIs
Brought to you by:
agraef
From: Tim H. <q...@st...> - 2004-06-29 08:53:20
|
Hi, Maybe this is a FAQ; if so, could someone point me at an appropriate bit of docs? 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. 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=3Dstrcat [MimeType, cookies, "\n", BODY]; | main ARGS =3D writes PAGE ; then obviously my webpage comes out with `()' on the bottom. This invalidates the generated RSS stream or XHTML page. I've worked around this by implementing a Content-Length header, but ideally don't want it to appear at all. I've looked for more options like `-q' but nothing says "don't print the final expression value". I can't readily think of an expression that doesn't return a visible/printable value. I've tried qcwrap-ing the script and compiling that, but where I've had that work, it's filled up /tmp with /tmp/file* files. Can anyone help? Do I have to bite the bullet and install mod_q?=20 I have: | zsh/scr7, potato 9:51AM public_html/ % q --version | Q interpreter version 5.3 (i686-pc-linux-gnu) | Copyright (c) 1991-2004 by Albert Graef All thoughts welcome :) TIA, ~Tim =2D-=20 <http://spodzone.org.uk/> |