[Templates] Template::Provider::HTTP under mod_perl

[prev] [thread] [next] [Date index for 2004/10/05]

From: Tosh Cooey
Subject: [Templates] Template::Provider::HTTP under mod_perl
Date: 12:55 on 05 Oct 2004
The Template::Provider::HTTP from the Badger Badger Badger book works great for 
me (tm) but as soon as I run it under mod_perl2 I get:

file error - /web/club/clubdates2.htm: absolute paths are not allowed (set 
ABSOLUTE option)\n

No problem, just set absolute:
my $pageOBJ = new Template({
     LOAD_TEMPLATES => [
         $prov,
         $http,
     ],
     PREFIX_MAP => {
         http => 1,
         default => 0,
     },
	ABSOLUTE => 1 });

But that doesn't resolve anything.  The only thing I can think of is that 
Template::Provider(::HTTP) overrides my ABSOLUTE => 1 argument, but I can't see 
where that is being done within the Template::Provider::HTTP module, and I don't 
see why it wouldn't work under mod_perl2 ...

I can see in Template::Provider where this is likely being caught:
     elsif (File::Spec->file_name_is_absolute($name)) {
         # absolute paths (starting '/') allowed if ABSOLUTE set
         ($data, $error) = $self->{ ABSOLUTE }
             ? $self->_fetch($name)
             : $self->{ TOLERANT }
                 ? (undef, Template::Constants::STATUS_DECLINED)
             : ("$name: absolute paths are not allowed (set ABSOLUTE option)",
                Template::Constants::STATUS_ERROR);
     }

But I am at a loss how to get around it...

Thanks for any insight from anyone!!!

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] Template::Provider::HTTP under mod_perl
Tosh Cooey 12:55 on 05 Oct 2004

Generated at 08:56 on 15 Mar 2005 by mariachi v0.52