1*e0c4386eSCy SchubertRevision history for Text::Template 2*e0c4386eSCy Schubert 3*e0c4386eSCy Schubert1.56 2019-07-09 4*e0c4386eSCy Schubert - Fix typos in Changes 5*e0c4386eSCy Schubert 6*e0c4386eSCy Schubert1.55 2019-02-25 7*e0c4386eSCy Schubert - Improve AppVeyor tests for older Perls (Thanks Roy Ivy) 8*e0c4386eSCy Schubert - Check for Test::More 0.94 and skip tests if not installed where 9*e0c4386eSCy Schubert done_testing() is used (Thanks Roy Ivy). 10*e0c4386eSCy Schubert - Improve workaround for broken Win32 File::Temp taint failure (Thanks Roy Ivy). 11*e0c4386eSCy Schubert - Skip/todo tests which fail under Devel::Cover (Thanks Roy Ivy) 12*e0c4386eSCy Schubert - Add checks and skip_all checks for non-core test modules (Thanks Roy Ivy) 13*e0c4386eSCy Schubert 14*e0c4386eSCy Schubert1.54 2019-01-13 15*e0c4386eSCy Schubert - Fix tempfile creation during tests on Win32 16*e0c4386eSCy Schubert 17*e0c4386eSCy Schubert1.53 2018-05-02 18*e0c4386eSCy Schubert - Add support for decoding template files via ENCODING constructor arg 19*e0c4386eSCy Schubert [github #11] 20*e0c4386eSCy Schubert - Docs cleanup: replace indirect-object style examples and use class method 21*e0c4386eSCy Schubert style constructor calls in the POD docs 22*e0c4386eSCy Schubert - Docs cleanup: remove hard tabs from POD, replace dated, unfair synopsis 23*e0c4386eSCy Schubert [github #5], convert "THANKS" section to a POD list 24*e0c4386eSCy Schubert 25*e0c4386eSCy Schubert1.52 2018-03-19 26*e0c4386eSCy Schubert - Fix possible 'Subroutine ... redefined' warning (Github #10) 27*e0c4386eSCy Schubert 28*e0c4386eSCy Schubert1.51 2018-03-04 29*e0c4386eSCy Schubert - Add test for nested tags breakage that happened in v1.46 30*e0c4386eSCy Schubert - Turn off strict+warnings in sections where template code is eval'ed 31*e0c4386eSCy Schubert [github #9] 32*e0c4386eSCy Schubert 33*e0c4386eSCy Schubert1.50 2018-02-10 34*e0c4386eSCy Schubert *** Revert support for identical start/end delimiters (e.g.: @@foo@@, XXfooXX) 35*e0c4386eSCy Schubert due to breakage with nested tags (see 36*e0c4386eSCy Schubert https://github.com/mschout/perl-text-template/issues/8). Will revisit 37*e0c4386eSCy Schubert this in a future release. 38*e0c4386eSCy Schubert 39*e0c4386eSCy Schubert1.49 2018-02-07 40*e0c4386eSCy Schubert - Fix failing tests in v1.48 under perl < 5.8.9 41*e0c4386eSCy Schubert 42*e0c4386eSCy Schubert1.48 2018-02-07 43*e0c4386eSCy Schubert - remove COPYING and Artistic files from the dist. These are replaced by 44*e0c4386eSCy Schubert the Dist::Zilla generated LICENSE file. 45*e0c4386eSCy Schubert - use strict/warnings (thanks Mohammad S Anwar) 46*e0c4386eSCy Schubert - remove $VERSION checks from tests. This makes it easier to run the test 47*e0c4386eSCy Schubert with Dist::Zilla and avoids maintenance issue of updating the tests for 48*e0c4386eSCy Schubert each release (Thanks Andrew Ruder). 49*e0c4386eSCy Schubert - Allow precompiled templates to work with preprocessing [#29928] (Thanks 50*e0c4386eSCy Schubert Nik LaBelle) 51*e0c4386eSCy Schubert - Add "strict" option to fill_in(). This adds "use strict" and "use vars 52*e0c4386eSCy Schubert (...)" to the prepend section, and only the keys of the HASH option are 53*e0c4386eSCy Schubert allowed in the template. (Thanks Desmond Daignault, Kivanc Yazan, CJM) 54*e0c4386eSCy Schubert [55696] 55*e0c4386eSCy Schubert - Fix templates with inline comments without newline after comment for perl 56*e0c4386eSCy Schubert < 5.18 [34292] 57*e0c4386eSCy Schubert - Don't use bareword file handles 58*e0c4386eSCy Schubert - use three arg form of open() 59*e0c4386eSCy Schubert - Fix BROKEN behaviour so that it returns the text accumulated so far on 60*e0c4386eSCy Schubert undef as documented [28974] 61*e0c4386eSCy Schubert - Source code cleanups 62*e0c4386eSCy Schubert - Minimum perl version is now 5.8.0 63*e0c4386eSCy Schubert - Allow start/end delimiters to be identical (e.g.: @@foo@@, XXfooXX) 64*e0c4386eSCy Schubert (Thanks mirod) [46639] 65*e0c4386eSCy Schubert - Fix + document the FILENAME parameter to fill_in() (Thanks VDB) [106093] 66*e0c4386eSCy Schubert - Test suite cleanups: 67*e0c4386eSCy Schubert + turn on strict/warnings for all tests 68*e0c4386eSCy Schubert + run tests through perltidy and formatting cleanup 69*e0c4386eSCy Schubert + remove number prefixes from test names 70*e0c4386eSCy Schubert + use Test::More instead of generating TAP by hand 71*e0c4386eSCy Schubert + use three-arg form of open() 72*e0c4386eSCy Schubert + don't use indirect object syntax 73*e0c4386eSCy Schubert + don't use bareword file handles 74*e0c4386eSCy Schubert + use File::Temp to generate temporary files 75*e0c4386eSCy Schubert 76*e0c4386eSCy Schubert1.47 2017-02-27 77*e0c4386eSCy Schubert - Fix longstanding memory leak in _scrubpkg() [#22031] 78*e0c4386eSCy Schubert - Fix various spelling errors [#86872] 79*e0c4386eSCy Schubert 80*e0c4386eSCy SchubertNOTE: Changes for versions prior to 1.47 have been imported from README 81*e0c4386eSCy Schubert 82*e0c4386eSCy Schubert1.46 2013-02-11 83*e0c4386eSCy Schubert - Thanks to Rik Signes, there is a new 84*e0c4386eSCy Schubert Text::Template->append_text_to_output method, which Text::Template always 85*e0c4386eSCy Schubert uses whenever it wants to emit output. You can subclass this to get 86*e0c4386eSCy Schubert control over the output, for example for postprocessing. 87*e0c4386eSCy Schubert - A spurious warning is no longer emitted when the TYPE parameter to ->new 88*e0c4386eSCy Schubert is omitted. 89*e0c4386eSCy Schubert 90*e0c4386eSCy Schubert1.45 2008-04-16 91*e0c4386eSCy Schubert 92*e0c4386eSCy Schubert1.44 2003-04-29 93*e0c4386eSCy Schubert - This is a maintenance release. There are no feature changes. 94*e0c4386eSCy Schubert - _scrubpkg, which was responsible for eptying out temporary packages after 95*e0c4386eSCy Schubert the module had done with them, wasn't always working; the result was 96*e0c4386eSCy Schubert memory leaks in long-running applications. This should be fixed now, and 97*e0c4386eSCy Schubert there is a test in the test suite for it. 98*e0c4386eSCy Schubert - Minor changes to the test suite to prevent spurious errors. 99*e0c4386eSCy Schubert - Minor documentation changes. 100*e0c4386eSCy Schubert 101*e0c4386eSCy Schubert1.43 2002-03-25 102*e0c4386eSCy Schubert - The ->new method now fails immediately and sets $Text::Template::ERROR if 103*e0c4386eSCy Schubert the file that is named by a filename argument does not exist or cannot be 104*e0c4386eSCy Schubert opened for some other reason. Formerly, the constructor would succeed 105*e0c4386eSCy Schubert and the ->fill_in call would fail. 106*e0c4386eSCy Schubert 107*e0c4386eSCy Schubert1.42 2001-11-05 108*e0c4386eSCy Schubert - This is a maintenance release. There are no feature changes. 109*e0c4386eSCy Schubert - Fixed a bug relating to use of UNTAINT under perl 5.005_03 and possibly 110*e0c4386eSCy Schubert other versions. 111*e0c4386eSCy Schubert - Taint-related tests are now more comprehensive. 112*e0c4386eSCy Schubert 113*e0c4386eSCy Schubert1.41 2001-09-04 114*e0c4386eSCy Schubert - This is a maintenance release. There are no feature changes. 115*e0c4386eSCy Schubert - Tests now work correctly on Windows systems and possibly on other 116*e0c4386eSCy Schubert non-unix systems. 117*e0c4386eSCy Schubert 118*e0c4386eSCy Schubert1.40 2001-08-30 119*e0c4386eSCy Schubert *** INCOMPATIBLE CHANGE *** 120*e0c4386eSCy Schubert - The format of the default error message has changed. It used to look 121*e0c4386eSCy Schubert like: 122*e0c4386eSCy Schubert 123*e0c4386eSCy Schubert Program fragment at line 30 delivered error ``Illegal division by zero'' 124*e0c4386eSCy Schubert 125*e0c4386eSCy Schubert It now looks like: 126*e0c4386eSCy Schubert 127*e0c4386eSCy Schubert Program fragment delivered error ``Illegal division by zero at catalog.tmpl line 37'' 128*e0c4386eSCy Schubert 129*e0c4386eSCy Schubert Note that the default message used to report the line number at which the 130*e0c4386eSCy Schubert program fragment began; it now reports the line number at which the error 131*e0c4386eSCy Schubert actually occurred. 132*e0c4386eSCy Schubert 133*e0c4386eSCy Schubert *** INCOMPATIBLE CHANGE *** 134*e0c4386eSCy Schubert - The format of the default error message has changed. It used to look like: 135*e0c4386eSCy Schubert 136*e0c4386eSCy Schubert Program fragment at line 30 delivered error ``Illegal division by zero'' 137*e0c4386eSCy Schubert 138*e0c4386eSCy Schubert It now looks like: 139*e0c4386eSCy Schubert 140*e0c4386eSCy Schubert Program fragment delivered error ``Illegal division by zero at catalog.tmpl line 37'' 141*e0c4386eSCy Schubert 142*e0c4386eSCy Schubert - Note that the default message used to report the line number at which the 143*e0c4386eSCy Schubert program fragment began; it now reports the line number at which the error 144*e0c4386eSCy Schubert actually occurred. 145*e0c4386eSCy Schubert - New UNTAINT option tells the module that it is safe to 'eval' code even 146*e0c4386eSCy Schubert though it has come from a file or filehandle. 147*e0c4386eSCy Schubert - Code added to prevent memory leaks when filling many templates. Thanks 148*e0c4386eSCy Schubert to Itamar Almeida de Carvalho. 149*e0c4386eSCy Schubert - Bug fix: $OUT was not correctly initialized when used in conjunction 150*e0c4386eSCy Schubert with SAFE. 151*e0c4386eSCy Schubert - You may now use a glob ref when passing a filehandle to the ->new 152*e0c4386eSCy Schubert function. Formerly, a glob was required. 153*e0c4386eSCy Schubert - New subclass: Text::Template::Preprocess. Just like Text::Template, but 154*e0c4386eSCy Schubert you may supply a PREPROCESS option in the constructor or the fill_in 155*e0c4386eSCy Schubert call; this is a function which receives each code fragment prior to 156*e0c4386eSCy Schubert evaluation, and which may modify and return the fragment; the modified 157*e0c4386eSCy Schubert fragment is what is evaluated. 158*e0c4386eSCy Schubert - Error messages passed to BROKEN subroutines will now report the correct 159*e0c4386eSCy Schubert line number of the template at which the error occurred: 160*e0c4386eSCy Schubert 161*e0c4386eSCy Schubert Illegal division by zero at template line 37. 162*e0c4386eSCy Schubert 163*e0c4386eSCy Schubert - If the template comes from a file, the filename will be reported as well: 164*e0c4386eSCy Schubert 165*e0c4386eSCy Schubert Illegal division by zero at catalog.tmpl line 37. 166*e0c4386eSCy Schubert 167*e0c4386eSCy Schubert - New UNTAINT option tells the module that it is safe to eval template code 168*e0c4386eSCy Schubert even if it has come from a file or filehandle, disabling taint checking 169*e0c4386eSCy Schubert in these cases. 170*e0c4386eSCy Schubert - Code added to prevent memory leaks when filling many templates. Thanks to 171*e0c4386eSCy Schubert Itamar Almeida de Carvalho. 172*e0c4386eSCy Schubert - Bug fix: $OUT was not always correctly initialized when used in 173*e0c4386eSCy Schubert conjunction with SAFE. 174*e0c4386eSCy Schubert - You may now use a glob ref when passing a filehandle to the new function. 175*e0c4386eSCy Schubert Formerly, a glob was required. 176*e0c4386eSCy Schubert - Error messages passed to BROKEN subroutines will now report the correct 177*e0c4386eSCy Schubert line number of the template at which the error occurred: 178*e0c4386eSCy Schubert 179*e0c4386eSCy Schubert Illegal division by zero at template line 37. 180*e0c4386eSCy Schubert 181*e0c4386eSCy Schubert If the template comes from a file, the filename will be reported as well: 182*e0c4386eSCy Schubert 183*e0c4386eSCy Schubert Illegal division by zero at catalog.tmpl line 37. 184*e0c4386eSCy Schubert 185*e0c4386eSCy Schubert - New subclass: Text::Template::Preprocess. Just like Text::Template, but 186*e0c4386eSCy Schubert you may supply a PREPROCESS option in the fill_in call; this is a 187*e0c4386eSCy Schubert function which receives each code fragment prior to evaluation, and which 188*e0c4386eSCy Schubert may modify and return the fragment; the modified fragment is what is 189*e0c4386eSCy Schubert evaluated. 190*e0c4386eSCy Schubert 191*e0c4386eSCy Schubert1.31 2001-02-05 192*e0c4386eSCy Schubert - Maintenance and bug fix release 193*e0c4386eSCy Schubert - fill_in_string was failing. Thanks to Donald L. Greer Jr. for the test case. 194*e0c4386eSCy Schubert 195*e0c4386eSCy Schubert1.23 1999-12-21 196*e0c4386eSCy Schubert - Small bug fix: DELIMITER and other arguments were being ignored in calls 197*e0c4386eSCy Schubert to fill_in_file and fill_this_in. (Thanks to Jonathan Roy for reporting 198*e0c4386eSCy Schubert this.) 199*e0c4386eSCy Schubert 200*e0c4386eSCy Schubert1.22 201*e0c4386eSCy Schubert - You can now specify that certain Perl statements be prepended to the 202*e0c4386eSCy Schubert beginning of every program fragment in a template, either per template, 203*e0c4386eSCy Schubert or for all templates, or for the duration of only one call to fill_in. 204*e0c4386eSCy Schubert This is useful, for example, if you want to enable `strict' checks in 205*e0c4386eSCy Schubert your templates but you don't want to manually add `use strict' to the 206*e0c4386eSCy Schubert front of every program fragment everywhere. 207*e0c4386eSCy Schubert 208*e0c4386eSCy Schubert1.20 1999-03-08 209*e0c4386eSCy Schubert - You can now specify that the program fragment delimiters are strings 210*e0c4386eSCy Schubert other than { and }. This has three interesting effects: First, it 211*e0c4386eSCy Schubert changes the delimiter strings. Second, it disables the special meaning 212*e0c4386eSCy Schubert of \, so you have to be really, really sure that the delimiters will not 213*e0c4386eSCy Schubert appear in your templates. And third, because of the simplifications 214*e0c4386eSCy Schubert introduced by the elimination of \ processing, template parsing is 20-25% 215*e0c4386eSCy Schubert faster. See the manual section on `Alternative Delimiters'. 216*e0c4386eSCy Schubert - Fixed bug having to do with undefined values in HASH options. In 217*e0c4386eSCy Schubert particular, Text::Template no longer generates a warning if you try to 218*e0c4386eSCy Schubert give a variable an undefined value. 219*e0c4386eSCy Schubert 220*e0c4386eSCy Schubert1.12 1999-02-28 221*e0c4386eSCy Schubert - I forgot to say that Text::Template ISA Exporter, so the exported 222*e0c4386eSCy Schubert functions never got exported. Duhhh! 223*e0c4386eSCy Schubert - Template TYPEs are now case-insensitive. The `new' method now diagnoses 224*e0c4386eSCy Schubert attempts to use an invalid TYPE. 225*e0c4386eSCy Schubert - More tests for these things. 226*e0c4386eSCy Schubert 227*e0c4386eSCy Schubert1.11 1999-02-25 228*e0c4386eSCy Schubert - Fixed a bug in the way backslashes were processed. The 1.10 behavior was 229*e0c4386eSCy Schubert incompatible with the beta versions and was also inconvenient. (`\n' in 230*e0c4386eSCy Schubert templates was replaced with `n' before it was given to Perl for 231*e0c4386eSCy Schubert evaluation.) The new behavior is also incompatible with the beta 232*e0c4386eSCy Schubert versions, but it is only a little bit incompatible, and it is probably 233*e0c4386eSCy Schubert better. 234*e0c4386eSCy Schubert - Documentation for the new behavior, and tests for the bug. 235*e0c4386eSCy Schubert 236*e0c4386eSCy Schubert1.10 1999-02-13 237*e0c4386eSCy Schubert - New OUTPUT option delivers template results directly to a filehandle 238*e0c4386eSCy Schubert instead of making them into a string. Saves space and time. 239*e0c4386eSCy Schubert - PACKAGE and HASH now work intelligently with SAFE. 240*e0c4386eSCy Schubert - Fragments may now output data directly to the template, rather than 241*e0c4386eSCy Schubert having to arrange to return it as a return value at the end. This means 242*e0c4386eSCy Schubert that where you used to have to write this: 243*e0c4386eSCy Schubert 244*e0c4386eSCy Schubert { my $blist = ''; 245*e0c4386eSCy Schubert foreach $i (@items) { 246*e0c4386eSCy Schubert $blist .= qq{ * $i\n}; 247*e0c4386eSCy Schubert } 248*e0c4386eSCy Schubert $blist; 249*e0c4386eSCy Schubert } 250*e0c4386eSCy Schubert 251*e0c4386eSCy Schubert You can now write this instead, because $OUT is special. 252*e0c4386eSCy Schubert 253*e0c4386eSCy Schubert { foreach $i (@items) { 254*e0c4386eSCy Schubert $OUT.= " * $i\n"; 255*e0c4386eSCy Schubert } 256*e0c4386eSCy Schubert } 257*e0c4386eSCy Schubert 258*e0c4386eSCy Schubert (`A spoonful of sugar makes the medicine go down.') 259*e0c4386eSCy Schubert - Fixed some small bugs. Worked around a bug in Perl that does the wrong 260*e0c4386eSCy Schubert thing with $x = <Y> when $x contains a glob. 261*e0c4386eSCy Schubert - More documentation. Errors fixed. 262*e0c4386eSCy Schubert - Lots more tests. 263*e0c4386eSCy Schubert 264*e0c4386eSCy Schubert1.03 1999-02-06 265*e0c4386eSCy Schubert - Code added to support HASH option to fill_in. (Incl. `_gensym' 266*e0c4386eSCy Schubert function.) 267*e0c4386eSCy Schubert - Documentation for HASH. 268*e0c4386eSCy Schubert - New test file for HASH. 269*e0c4386eSCy Schubert - Note about failure of lexical variables to propagate into templates. Why 270*e0c4386eSCy Schubert does this surprise people? 271*e0c4386eSCy Schubert - Bug fix: program fragments are evaluated in an environment with `no 272*e0c4386eSCy Schubert strict' by default. Otherwise, you get a lot of `Global symbol "$v" 273*e0c4386eSCy Schubert requires explicit package name' failures. Why didn't the test program 274*e0c4386eSCy Schubert pick this up? Because the only variable the test program ever used was 275*e0c4386eSCy Schubert `$a', which is exempt. Duhhhhh. 276*e0c4386eSCy Schubert - Fixed the test program. 277*e0c4386eSCy Schubert - Various minor documentation fixes. 278*e0c4386eSCy Schubert 279*e0c4386eSCy Schubert1.00 1999-02-05 280*e0c4386eSCy Schubert This is a complete rewrite. The new version delivers better functionality 281*e0c4386eSCy Schubert but is only 2/3 as long, which I think is a good sign. It is supposed to be 282*e0c4386eSCy Schubert 100% backward-compatible with the previous versions. With one cosmetic 283*e0c4386eSCy Schubert change, it passes the test suite that the previous versions passed. If you 284*e0c4386eSCy Schubert have compatibility problems, please mail me immediately. 285*e0c4386eSCy Schubert 286*e0c4386eSCy Schubert - At least twice as fast 287*e0c4386eSCy Schubert - Better support for filling out the same template more than once 288*e0c4386eSCy Schubert - Now supports evaluation of program fragments in Safe compartments. 289*e0c4386eSCy Schubert (Thanks, Jonathan!) 290*e0c4386eSCy Schubert - Better argument syntax 291*e0c4386eSCy Schubert - More convenience functions 292*e0c4386eSCy Schubert - The parser is much better and simpler 293*e0c4386eSCy Schubert - Once a template is parsed, the parsed version is stored so that 294*e0c4386eSCy Schubert it needn't be parsed again. 295*e0c4386eSCy Schubert - BROKEN function behavior is rationalized. You can now pass an 296*e0c4386eSCy Schubert arbitrary argument to your BROKEN function, or return a value 297*e0c4386eSCy Schubert from it to the main program. 298*e0c4386eSCy Schubert - Documentation overhauled. 299*e0c4386eSCy Schubert 300*e0c4386eSCy SchubertPrevious Versions 301*e0c4386eSCy Schubert - Maintained by Mark Jason Dominus (MJD) 302