Sam,

The reason it is failing is the split:

   # look for the included file...
   my @path = split('/', $options->{filepath});

Durint the test, $options->{filepath} contains
"templates\include_path\a.tmpl", note that backslash
delimiter.

This fix works for me, but I don't know if there are other splits elsewhere:

   my @path = File::Spec->splitdir($options->{filepath});

-Dave

----- Original Message -----
From: "Sam Tregar" <[EMAIL PROTECTED]>
To: "David Ferrance" <[EMAIL PROTECTED]>
Sent: Tuesday, January 15, 2002 7:02 PM
Subject: Re: [htmltmpl] TMPL_INCLUDE question


> On Tue, 15 Jan 2002, David Ferrance wrote:
>
> > Not sure I understand-- is it the enclosing file's directory that is
> > supposed to be used then?
>
> Yes, unless it thinks you're using an "absolute" path (using
> File::Spec->file_name_is_absolute).
>
> > I ran the test earlier with a failure of this test (#40):
> >
> > print "daf1\n";
> > $template = HTML::Template->new(filename =>
> > './templates/include_path/a.tmpl');
> > $output =  $template->output;
> > ok($output =~ /Bar/);
> > print "daf2\n";
>
> And this test passes under Activestate with HTML::Template 2.3?
>
> > HTML::Template->new() : Cannot open include
> > /Perl/site/lib/HTML/Template.pm line 2024.
>
> Um, that doesn't look right.  Did you chop off the name of the file it
> can't find?  I'm wondering if maybe File::Spec thinks it's an absolute
> path.
>
> I'll try installing Activestate on my Windows box tonight and see if I can
> reproduce the problem.
>
> -sam
>
>
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to