Subject: | HTML-ElementRaw uninitialized warnings - patch |
Hi,
I'm getting lots of errors in my logfile saying:
Use of uninitialized value in join or string at
c:/vanilla-perl/perl/site/lib/HTML/ElementRaw.pm line 27.
I've changed the code so that any empty items in @text are the empty
string "" instead of undef.
My change doesn't seem to have any adverse side-effects, but then
there's not many tests to run against ;)
My calendar app is running fine though.
This is for file HTML/ElementRaw.pm 1.10 from the distribution
HTML-Element-Extended-1.14
I'm running perl 5.8.8 on winxp sp2.
Here's a unified diff,
Cheers!
@@ -23,7 +23,8 @@
sub push_content {
# Flatten elements into an HTML string if found,
# otherwise just slap the text in.
- my @text = map(ref $_ ? $_->as_HTML : $_, @_);
+ my @text = map {defined() ? $_ : ''}
+ map(ref $_ ? $_->as_HTML : $_, @_);
shift->{_string}[0] .= join('',@text);
}
sub insert_element {