Subject: | [PATCH] XML::Atom::Base warns from tests for XML::Feed |
While testing XML::Feed with bleadperl, the following warnings came out
of t/04-splice.t
t/04-splice...........ok 1/3Use of uninitialized value $val in
subroutine entry at /tmp/bleadperl/lib/site_perl/5.9.5/XML/Atom/Base.pm
line 109.
Use of uninitialized value $val in subroutine entry at
/tmp/bleadperl/lib/site_perl/5.9.5/XML/Atom/Base.pm line 109.
The following patch seems to silence the warnings while keeping the
tests passing.
--- lib/XML/Atom/Base.pm.old 2006-11-24 13:38:51.000000000 -0600
+++ lib/XML/Atom/Base.pm 2006-11-24 13:38:02.000000000 -0600
@@ -81,6 +81,7 @@
sub set {
my $obj = shift;
my($ns, $name, $val, $attr, $add) = @_;
+ return $val if ! defined $val;
my $ns_uri = ref $ns eq 'XML::Atom::Namespace' ? $ns->{uri} : $ns;
my @elem = childlist($obj->elem, $ns_uri, $name);
if (!$add && @elem) {