Skip Menu |

This queue is for tickets about the Template-Toolkit CPAN distribution.

Report information
The Basics
Id: 64142
Status: resolved
Priority: 0/
Queue: Template-Toolkit

People
Owner: Nobody in particular
Requestors: SREZIC [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 2.22
Fixed in: (no value)



Subject: Template files with mtime=0 not handled
Template files with mtime=0 (typically 1970-01-01 on Unix systems) cannot be handled by Template Toolkit. This can be easily tested with this script: #!/usr/bin/perl use strict; use File::Temp qw(tempfile); use Template; my($tmpfh,$tmpfile) = tempfile(UNLINK => 1); print $tmpfh "hello, world\n"; close $tmpfh or die $!; utime 0, 0, $tmpfile or die $!; Template->new({ABSOLUTE => 1})->process($tmpfile, {}) or die; __END__ If the "utime" line is removed, then the script runs without problems. Reason for this: there are a couple of places in Template::Provider, where modtime checks are not done using "defined", but with a mere "if (...)" or "... ||". Getting the mtime in TT2 is done using the _template_modified method, so probably all calls of this methods should be checked. (If the problem is accepted, then I can provide a patch for it) Regards, Slaven
Ticket migrated to github as https://github.com/abw/Template2/issues/102