Skip to content

Commit

Permalink
Fix undef warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
bobtfish committed Feb 14, 2012
1 parent cf2618d commit ae346c3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions Changes
@@ -1,3 +1,7 @@
- Fix Log::Message::Structured::Stringify::Sprintf warnings when values
in the sprintf string are undef. They are now literally printed as
'undef'

0.002
- Fix docs for Stringify::Sprintf

Expand Down
2 changes: 1 addition & 1 deletion lib/Log/Message/Structured/Stringify/Sprintf.pm
Expand Up @@ -28,7 +28,7 @@ role {
my $self = shift;
# FIXME - Find the correct reader name rather than assuming
# attribute name == accessor name.
sprintf($format_string, map { $self->$_ } @attributes);
sprintf($format_string, map { my $val = $self->$_; $val = 'undef' unless defined $val; $val } @attributes);
};
};

Expand Down

0 comments on commit ae346c3

Please sign in to comment.