[Templates] url string w/ template toolkit

Kate L Pugh kake@earth.li
Wed, 1 Oct 2003 00:07:40 +0100


JustSome person <justsomename2002@yahoo.com> [2003-09-30 22:46]:
>> using template toolkit, can I read the URL string?

On Wed 01 Oct 2003, "A. Pagaltzis" <pagaltzis@gmx.de> wrote:
> No, because TT doesn't have anything to do with network protocols
> or anything of that sort. Where does your URL come from? Are you
> writing a CGI script? (I asked this before.) Are you using the
> CGI module? (Dito.)

You're pretending to be dumb in order to make the point that Template
Toolkit can be used for things other than CGI.  This just makes you
look nasty and petty.  Of course he's writing a CGI script.  Why not
just answer his question and then make your point explicitly.

james, the answer to your question is that you want to use the CGI.pm
plugin for Template Toolkit, and a template something like:

----------------------------------------------------------------------
[% USE CGI %]

<html><head><title>Test</title></head><body>

<h1>Test</h1>

<pre>
[% CGI.url %]
</pre>

</body>
</html>
----------------------------------------------------------------------

See 'perldoc Template::Plugin::CGI' and 'perldoc CGI' for more information.


Kake