[Templates] INCLUDE a file via http:
[prev]
[thread]
[next]
[Date index for 2004/07/15]
I want to INCLUDE a file via http: and the FAQ says:
"Here's one way. Set the LOAD_PERL option:"
I'd rather not use the LOAD_PERL option... but then the solution is from 2001
and someone has come up with a better solution since then right?
right?
please....?
Oh, in case you haven't seen the FAQ here's the solution:
use Template;
my $template = Template->new({
LOAD_PERL => 1
});
$template->process("example.tt", { stdout => *STDOUT })
|| die $template->error();
and then use LWP::UserAgent and HTTP::Request:
[%
USE ua = LWP.UserAgent;
ua.proxy("http", "http://your_proxy/");
USE req = HTTP.Request("GET", "http://www.cpan.org");
ua.request(req).content;
-%]
Thanks!!
Tosh
--
McIntosh Cooey - Twelve Hundred Group LLC - http://www.1200group.com/
_______________________________________________
templates mailing list
templates@xxxxxxxxxxxxxxxx.xxx
http://lists.template-toolkit.org/mailman/listinfo/templates
 |
[Templates] INCLUDE a file via http:
Tosh Cooey 19:12 on 15 Jul 2004
|