[Templates-cvs] cvs commit: Template2/lib Template.pm
cvs@template-toolkit.org
cvs@template-toolkit.org
Mon, 04 Oct 2004 11:11:59 +0100
cvs 04/10/04 10:11:59
Modified: lib Template.pm
Log:
* fix binmode code to prevent undefined/not numerical comparison warnings
Revision Changes Path
2.79 +7 -3 Template2/lib/Template.pm
Index: Template.pm
===================================================================
RCS file: /template-toolkit/Template2/lib/Template.pm,v
retrieving revision 2.78
retrieving revision 2.79
diff -u -r2.78 -r2.79
--- Template.pm 2004/09/17 07:47:17 2.78
+++ Template.pm 2004/10/04 10:11:59 2.79
@@ -17,7 +17,7 @@
# modify it under the same terms as Perl itself.
#
# REVISION
-# $Id: Template.pm,v 2.78 2004/09/17 07:47:17 abw Exp $
+# $Id: Template.pm,v 2.79 2004/10/04 10:11:59 abw Exp $
#
#========================================================================
@@ -193,8 +193,12 @@
elsif (open(FP, ">$where")) {
# binmode option can be 1 or a specific layer, e.g. :utf8
my $bm = $options->{ binmode };
- if ($bm == 1) { binmode FP }
- elsif ($bm) { binmode FP, $bm }
+ if ($bm && +$bm == 1) {
+ binmode FP;
+ }
+ elsif ($bm){
+ binmode FP, $bm;
+ }
print FP $$textref;
close FP;
}