Gossamer Forum
Home : General : Perl Programming :

Template doesnt work!!

Quote Reply
Template doesnt work!!
hey, i am trying to adapt a script i found on the internet but its not working. $fill_in is undef, but the values in SOURCE = '/cgi-bin/calendar/templates/hypercal.html' when strang together, which is the correct url for the file. i am using Text::Template.
thanks
Pedge

Code:
print "Content-type: text/html\n\n";my $fill_in = Template->new(
TYPE => 'FILE',
SOURCE => $self->templates . $args{TEMPLATES} . $template
);
my $filled = $fill_in->fill_in(
HASH => [ $self, $form, $details ],
DELIMITERS => [ '<%', '%>' ]
);
print $filled;
Quote Reply
Re: [pedge] Template doesnt work!! In reply to
ok, i think i have found out the problem but i'm not sure how to fix it.
the error i get is:

Couldn't open file /cgi-bin/calendar/templates/hypercal.html: No such file or directory

there is also some settings in the script and i'm not sure if they are correct. i am using indigoperl with perl 5.6.
# Locations and paths
install_dir => '/cgi-bin/calendar',
perl => 'perl',
server_name => "",
base_url => '/cgi-bin/calendar/',
month_dir => '/images/months', # URL of month images, no trailing /
icon_dir => '/images/icons', # URL of icons, no trailing /
templates => '/cgi-bin/calendar/templates',
Quote Reply
Re: [pedge] Template doesnt work!! In reply to
dont worry its fixed.
it was a set up problem.