Subject: | ttree - needs binmode() |
Date: | Thu, 31 Jul 2008 11:32:39 -0400 |
To: | bug-Template-Toolkit [...] rt.cpan.org |
From: | Lyle Brooks <brooks [...] deseret.com> |
While porting my TT2 application to a Windows environment, I
found that ttree was mangling my data (which worked fine in a
Linux environment).
With in ttree, in the method process_file()
Here is the code snippet...
389 # process file
390 unless ($dryrun) {
391 $template->process($file, $replace, $destfile)
392 || print(" ! ", $template->error(), "\n");
393
394 if ($preserve) {
395 chown($uid, $gid, $dest) || warn "chown($dest): $!\n";
396 chmod($mode, $dest) || warn "chmod($dest): $!\n";
397 }
398 }
I changed line 391 to read
391 $template->process($file, $replace, $destfile, { binmode => 1} )
and this seemed to correct the problem, but may need to be regression
tested.