--- Template-Toolkit-2.12/lib/Template/Filters.pm       Mon Jan 12 22:37:55 2004
+++ ../Filters.pm       Thu Mar 11 09:11:16 2004
@@ -677,7 +677,7 @@
                     # Try to extract just the interesting errors from
                     # the verbose log file
                     #
-                    while ( <FH> ) {
+                    while ( my $errline = <FH> ) {
                         #
                         # TeX errors seems to start with a "!" at the
                         # start of the line, and are followed several
@@ -686,11 +686,11 @@
                         # We make sure we pick up every /^!/ line, and
                         # the first /^l.\d/ line after each /^!/ line.
                         #
-                        if ( /^(!.*)/ ) {
+                        if ( $errline =~ /^(!.*)/ ) {
                             $texErrs .= $1 . "\n";
                             $state = 1;
                         }
-                        if ( $state == 1 && /^(l\.\d.*)/ ) {
+                        if ( $state == 1 && $errline =~ /^(l\.\d.*)/ ) {
                             $texErrs .= $1 . "\n";
                             $state = 0;
                         }
