[Templates-cvs] cvs commit: TT3/lib/Template/TT3 Base.pm
cvs@template-toolkit.org
cvs@template-toolkit.org
Tue, 16 Dec 2003 18:59:39 +0000
cvs 03/12/16 18:59:38
Modified: lib/Template/TT3 Base.pm
Log:
* fixed error() method to allow undef to be passed as an argument to
clear error without raising an "undefined value blah blah" warning
Revision Changes Path
1.3 +6 -4 TT3/lib/Template/TT3/Base.pm
Index: Base.pm
===================================================================
RCS file: /template-toolkit/TT3/lib/Template/TT3/Base.pm,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- Base.pm 2003/12/10 13:45:19 1.2
+++ Base.pm 2003/12/16 18:59:37 1.3
@@ -17,7 +17,7 @@
# modify it under the same terms as Perl itself.
#
# REVISION
-# $Id: Base.pm,v 1.2 2003/12/10 13:45:19 abw Exp $
+# $Id: Base.pm,v 1.3 2003/12/16 18:59:37 abw Exp $
#
#========================================================================
@@ -28,7 +28,7 @@
use vars qw( $VERSION $DEBUG $ERROR $WARNING );
-$VERSION = sprintf("%d.%02d", q$Revision: 1.2 $ =~ /(\d+)\.(\d+)/);
+$VERSION = sprintf("%d.%02d", q$Revision: 1.3 $ =~ /(\d+)\.(\d+)/);
$DEBUG = 0 unless defined $DEBUG;
$ERROR = '';
@@ -89,7 +89,9 @@
if (@_) {
# don't stringify objects passed as argument
- my $error = ref $_[0] ? shift : join('', @_);
+ my $error = ref $_[0]
+ ? shift
+ : join('', map { defined($_) ? $_ : '' } @_);
$self->{ _TT_ERROR } = $error if ref $self;
${"$class\::ERROR"} = $error;
return undef;
@@ -395,7 +397,7 @@
=head1 VERSION
-$Revision: 1.2 $
+$Revision: 1.3 $
=head1 COPYRIGHT